Microscopy Image Browser 2.91
MIB
Loading...
Searching...
No Matches
reg_RF.cpp File Reference
#include "memory.h"
#include "stdio.h"
#include "math.h"
#include "time.h"
#include "stdlib.h"
#include "qsort.c"
#include "reg_RF.h"
Include dependency graph for reg_RF.cpp:

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
 

Macro Definition Documentation

◆ INT_SMALL

#define INT_SMALL

◆ MAX_UINT_COKUS

#define MAX_UINT_COKUS   4294967295

◆ NODE_INTERIOR

#define NODE_INTERIOR   -3

◆ NODE_TERMINAL

#define NODE_TERMINAL   -1

◆ NODE_TOSPLIT

#define NODE_TOSPLIT   -2

◆ NULL

◆ swapInt

#define swapInt ( a,
b )
Value:
((a ^= b), (b ^= a), (a ^= b))

Referenced by findBestSplit(), and regRF().

Function Documentation

◆ computeProximity()

void computeProximity ( double * prox,
int oobprox,
int * node,
int * inbag,
int * oobpair,
int n )

References n.

Referenced by classForest(), classRF(), regForest(), and regRF().

Here is the caller graph for this function:

◆ findBestSplit()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRNGstate()

void GetRNGstate ( )

Referenced by regRF().

Here is the caller graph for this function:

◆ imax2()

int imax2 ( int x,
int y )

Referenced by findBestSplit().

Here is the caller graph for this function:

◆ pack()

int pack ( int nBits,
int * bits )

References pack().

Referenced by catmax(), catmaxb(), findBestSplit(), pack(), pack(), unpack(), and unpack().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ permuteOOB()

void permuteOOB ( int m,
double * x,
int * in,
int nsample,
int mdim )

References unif_rand().

Referenced by classRF(), and regRF().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ predictRegTree()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_regRF_params()

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.

◆ PutRNGstate()

void PutRNGstate ( )

Referenced by regRF().

Here is the caller graph for this function:

◆ regForest()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ regRF()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ regTree()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ simpleLinReg()

void simpleLinReg ( int nsample,
double * x,
double * y,
double * coef,
double * mse,
int * hasPred )

Referenced by regRF().

Here is the caller graph for this function:

◆ unif_rand()

double unif_rand ( )

References MAX_UINT_COKUS, and randomMT().

Referenced by catmax(), createClass(), findBestSplit(), permuteOOB(), and regRF().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unpack()

void unpack ( unsigned int pack,
int * bits )

References pack().

Referenced by catmax().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zeroDouble()

void zeroDouble ( double * x,
int length )

Referenced by classForest(), classRF(), findBestSplit(), oob(), regForest(), regRF(), regTree(), and TestSetError().

Here is the caller graph for this function:

◆ zeroInt()

void zeroInt ( int * x,
int length )

Referenced by catmax(), catmaxb(), classRF(), findBestSplit(), oob(), predictClassTree(), predictRegTree(), regForest(), regRF(), and regTree().

Here is the caller graph for this function:

◆ zeroSMALLInt()

void zeroSMALLInt ( void * x,
int length )

References SMALL_INT.

Referenced by regTree().

Here is the caller graph for this function:

Variable Documentation

◆ in_findBestSplit

int in_findBestSplit =0

Referenced by findBestSplit(), and regRF().

◆ in_regTree

int in_regTree =0

Referenced by regRF(), and regTree().