![]() |
Microscopy Image Browser 2.91
MIB
|
#include "memory.h"
#include "stdio.h"
#include "math.h"
#include "time.h"
#include "stdlib.h"
#include "qsort.c"
#include "reg_RF.h"
Macros | |
#define | NODE_TERMINAL -1 |
#define | NODE_TOSPLIT -2 |
#define | NODE_INTERIOR -3 |
#define | NULL 0 |
#define | swapInt(a, b) |
#define | INT_SMALL |
#define | MAX_UINT_COKUS 4294967295 |
Functions | |
void | GetRNGstate () |
void | PutRNGstate () |
double | unif_rand () |
void | zeroSMALLInt (void *x, int length) |
void | zeroInt (int *x, int length) |
void | zeroDouble (double *x, int length) |
int | imax2 (int x, int y) |
int | pack (int nBits, int *bits) |
void | unpack (unsigned int pack, int *bits) |
void | computeProximity (double *prox, int oobprox, int *node, int *inbag, int *oobpair, int n) |
void | permuteOOB (int m, double *x, int *in, int nsample, int mdim) |
void | simpleLinReg (int nsample, double *x, double *y, double *coef, double *mse, int *hasPred) |
void | predictRegTree (double *x, int nsample, int mdim, int *lDaughter, int *rDaughter, SMALL_INT *nodestatus, double *ypred, double *split, double *nodepred, int *splitVar, int treeSize, int *cat, int maxcat, int *nodex) |
void | regRF (double *x, double *y, int *xdim, int *sampsize, int *nthsize, int *nrnodes, int *nTree, int *mtry, int *imp, int *cat, int maxcat, int *jprint, int doProx, int oobprox, int biasCorr, double *yptr, double *errimp, double *impmat, double *impSD, double *prox, int *treeSize, SMALL_INT *nodestatus, int *lDaughter, int *rDaughter, double *avnode, int *mbest, double *upper, double *mse, const int *keepf, int *replace, int testdat, double *xts, int *nts, double *yts, int labelts, double *yTestPred, double *proxts, double *msets, double *coef, int *nout, int *inbag) |
void | regForest (double *x, double *ypred, int *mdim, int *n, int *ntree, int *lDaughter, int *rDaughter, SMALL_INT *nodestatus, int *nrnodes, double *xsplit, double *avnodes, int *mbest, int *treeSize, int *cat, int maxcat, int *keepPred, double *allpred, int doProx, double *proxMat, int *nodes, int *nodex) |
void | regTree (double *x, double *y, int mdim, int nsample, int *lDaughter, int *rDaughter, double *upper, double *avnode, SMALL_INT *nodestatus, int nrnodes, int *treeSize, int nthsize, int mtry, int *mbest, int *cat, double *tgini, int *varUsed) |
void | findBestSplit (double *x, int *jdex, double *y, int mdim, int nsample, int ndstart, int ndend, int *msplit, double *decsplit, double *ubest, int *ndendl, int *jstat, int mtry, double sumnode, int nodecnt, int *cat) |
void | print_regRF_params (int *xdim, int *sampsize, int *nthsize, int *nrnodes, int *nTree, int *mtry, int *imp, int *cat, int maxcat, int *jprint, int doProx, int oobprox, int biasCorr, double *yptr, double *errimp, double *impmat, double *impSD, double *prox, int *treeSize, SMALL_INT *nodestatus, int *lDaughter, int *rDaughter, double *avnode, int *mbest, double *upper, double *mse, int *keepf, int *replace, int testdat, double *xts, int *nts, double *yts, int labelts, double *yTestPred, double *proxts, double *msets, double *coef, int *nout, int *inbag) |
Variables | |
int | in_findBestSplit =0 |
int | in_regTree =0 |
#define INT_SMALL |
#define MAX_UINT_COKUS 4294967295 |
#define NODE_INTERIOR -3 |
#define NODE_TERMINAL -1 |
#define NODE_TOSPLIT -2 |
#define NULL 0 |
Referenced by Graph< captype, tcaptype, flowtype >.add_node(), Block< Type >.Block(), Block< Type >.Block(), classForest(), classRF(), DBlock< Type >.DBlock(), DBlock< Type >.DBlock(), Graph< captype, tcaptype, flowtype >.Graph(), main(), Graph< captype, tcaptype, flowtype >.maxflow(), mexFunction(), Block< Type >.New(), DBlock< Type >.New(), regForest(), regRF(), Block< Type >.ScanFirst(), Block< Type >.ScanFirst(), Block< Type >.ScanNext(), Block< Type >.ScanNext(), transformvolume_color(), and transformvolume_gray().
#define swapInt | ( | a, | |
b ) |
Referenced by findBestSplit(), and regRF().
void computeProximity | ( | double * | prox, |
int | oobprox, | ||
int * | node, | ||
int * | inbag, | ||
int * | oobpair, | ||
int | n ) |
References n.
Referenced by classForest(), classRF(), regForest(), and regRF().
void findBestSplit | ( | double * | x, |
int * | jdex, | ||
double * | y, | ||
int | mdim, | ||
int | nsample, | ||
int | ndstart, | ||
int | ndend, | ||
int * | msplit, | ||
double * | decsplit, | ||
double * | ubest, | ||
int * | ndendl, | ||
int * | jstat, | ||
int | mtry, | ||
double | sumnode, | ||
int | nodecnt, | ||
int * | cat ) |
References imax2(), in_findBestSplit, pack(), R_qsort_I(), swapInt, unif_rand(), zeroDouble(), and zeroInt().
Referenced by regRF(), and regTree().
void GetRNGstate | ( | ) |
int imax2 | ( | int | x, |
int | y ) |
int pack | ( | int | nBits, |
int * | bits ) |
void permuteOOB | ( | int | m, |
double * | x, | ||
int * | in, | ||
int | nsample, | ||
int | mdim ) |
References unif_rand().
Referenced by classRF(), and regRF().
void predictRegTree | ( | double * | x, |
int | nsample, | ||
int | mdim, | ||
int * | lDaughter, | ||
int * | rDaughter, | ||
SMALL_INT * | nodestatus, | ||
double * | ypred, | ||
double * | split, | ||
double * | nodepred, | ||
int * | splitVar, | ||
int | treeSize, | ||
int * | cat, | ||
int | maxcat, | ||
int * | nodex ) |
References NODE_TERMINAL, SMALL_INT, and zeroInt().
Referenced by regForest(), and regRF().
void print_regRF_params | ( | int * | xdim, |
int * | sampsize, | ||
int * | nthsize, | ||
int * | nrnodes, | ||
int * | nTree, | ||
int * | mtry, | ||
int * | imp, | ||
int * | cat, | ||
int | maxcat, | ||
int * | jprint, | ||
int | doProx, | ||
int | oobprox, | ||
int | biasCorr, | ||
double * | yptr, | ||
double * | errimp, | ||
double * | impmat, | ||
double * | impSD, | ||
double * | prox, | ||
int * | treeSize, | ||
SMALL_INT * | nodestatus, | ||
int * | lDaughter, | ||
int * | rDaughter, | ||
double * | avnode, | ||
int * | mbest, | ||
double * | upper, | ||
double * | mse, | ||
int * | keepf, | ||
int * | replace, | ||
int | testdat, | ||
double * | xts, | ||
int * | nts, | ||
double * | yts, | ||
int | labelts, | ||
double * | yTestPred, | ||
double * | proxts, | ||
double * | msets, | ||
double * | coef, | ||
int * | nout, | ||
int * | inbag ) |
References SMALL_INT.
void PutRNGstate | ( | ) |
void regForest | ( | double * | x, |
double * | ypred, | ||
int * | mdim, | ||
int * | n, | ||
int * | ntree, | ||
int * | lDaughter, | ||
int * | rDaughter, | ||
SMALL_INT * | nodestatus, | ||
int * | nrnodes, | ||
double * | xsplit, | ||
double * | avnodes, | ||
int * | mbest, | ||
int * | treeSize, | ||
int * | cat, | ||
int | maxcat, | ||
int * | keepPred, | ||
double * | allpred, | ||
int | doProx, | ||
double * | proxMat, | ||
int * | nodes, | ||
int * | nodex ) |
References computeProximity(), n, NULL, predictRegTree(), SMALL_INT, zeroDouble(), and zeroInt().
Referenced by main().
void regRF | ( | double * | x, |
double * | y, | ||
int * | xdim, | ||
int * | sampsize, | ||
int * | nthsize, | ||
int * | nrnodes, | ||
int * | nTree, | ||
int * | mtry, | ||
int * | imp, | ||
int * | cat, | ||
int | maxcat, | ||
int * | jprint, | ||
int | doProx, | ||
int | oobprox, | ||
int | biasCorr, | ||
double * | yptr, | ||
double * | errimp, | ||
double * | impmat, | ||
double * | impSD, | ||
double * | prox, | ||
int * | treeSize, | ||
SMALL_INT * | nodestatus, | ||
int * | lDaughter, | ||
int * | rDaughter, | ||
double * | avnode, | ||
int * | mbest, | ||
double * | upper, | ||
double * | mse, | ||
const int * | keepf, | ||
int * | replace, | ||
int | testdat, | ||
double * | xts, | ||
int * | nts, | ||
double * | yts, | ||
int | labelts, | ||
double * | yTestPred, | ||
double * | proxts, | ||
double * | msets, | ||
double * | coef, | ||
int * | nout, | ||
int * | inbag ) |
References computeProximity(), findBestSplit(), GetRNGstate(), in_findBestSplit, in_regTree, n, NULL, permuteOOB(), predictRegTree(), PutRNGstate(), regTree(), seedMT(), simpleLinReg(), SMALL_INT, swapInt, unif_rand(), zeroDouble(), and zeroInt().
Referenced by main().
void regTree | ( | double * | x, |
double * | y, | ||
int | mdim, | ||
int | nsample, | ||
int * | lDaughter, | ||
int * | rDaughter, | ||
double * | upper, | ||
double * | avnode, | ||
SMALL_INT * | nodestatus, | ||
int | nrnodes, | ||
int * | treeSize, | ||
int | nthsize, | ||
int | mtry, | ||
int * | mbest, | ||
int * | cat, | ||
double * | tgini, | ||
int * | varUsed ) |
References findBestSplit(), in_regTree, NODE_INTERIOR, NODE_TERMINAL, NODE_TOSPLIT, SMALL_INT, zeroDouble(), zeroInt(), and zeroSMALLInt().
Referenced by regRF().
double unif_rand | ( | ) |
References MAX_UINT_COKUS, and randomMT().
Referenced by catmax(), createClass(), findBestSplit(), permuteOOB(), and regRF().
void unpack | ( | unsigned int | pack, |
int * | bits ) |
void zeroDouble | ( | double * | x, |
int | length ) |
Referenced by classForest(), classRF(), findBestSplit(), oob(), regForest(), regRF(), regTree(), and TestSetError().
void zeroInt | ( | int * | x, |
int | length ) |
Referenced by catmax(), catmaxb(), classRF(), findBestSplit(), oob(), predictClassTree(), predictRegTree(), regForest(), regRF(), and regTree().
void zeroSMALLInt | ( | void * | x, |
int | length ) |
int in_findBestSplit =0 |
Referenced by findBestSplit(), and regRF().