Predict.c File Reference

#include "party.h"

Include dependency graph for Predict.c:

Go to the source code of this file.

Functions

void C_splitnode (SEXP node, SEXP learnsample, SEXP control)
SEXP C_get_node (SEXP subtree, SEXP newinputs, double mincriterion, int numobs)
SEXP R_get_node (SEXP subtree, SEXP newinputs, SEXP mincriterion, SEXP numobs)
SEXP C_get_nodebynum (SEXP subtree, int nodenum)
SEXP R_get_nodebynum (SEXP subtree, SEXP nodenum)
SEXP C_get_prediction (SEXP subtree, SEXP newinputs, double mincriterion, int numobs)
SEXP C_get_nodeweights (SEXP subtree, SEXP newinputs, double mincriterion, int numobs)
int C_get_nodeID (SEXP subtree, SEXP newinputs, double mincriterion, int numobs)
SEXP R_get_nodeID (SEXP tree, SEXP newinputs, SEXP mincriterion)
void C_predict (SEXP tree, SEXP newinputs, double mincriterion, SEXP ans)
SEXP R_predict (SEXP tree, SEXP newinputs, SEXP mincriterion)
void C_getpredictions (SEXP tree, SEXP where, SEXP ans)
SEXP R_getpredictions (SEXP tree, SEXP where)
SEXP R_predictRF_weights (SEXP forest, SEXP where, SEXP weights, SEXP newinputs, SEXP mincriterion, SEXP oobpred)


Detailed Description

Node splitting and prediction

Author:
Author
hothorn
Date:
Date
2007-07-23 10:02:09 +0200 (Mon, 23 Jul 2007)

Definition in file Predict.c.


Function Documentation

SEXP C_get_node SEXP  subtree,
SEXP  newinputs,
double  mincriterion,
int  numobs
 

Get the terminal node for obs. number `numobs' of `newinputs'

Parameters:
subtree a tree
newinputs an object of class `VariableFrame'
mincriterion overwrites mincriterion used for tree growing
numobs observation number
Todo:
handle surrogate splits

Definition at line 120 of file Predict.c.

References C_i_in_set(), get_missings(), get_variable(), has_missings(), S3get_leftnode(), S3get_maxcriterion(), S3get_nodeterminal(), S3get_primarysplit(), S3get_rightnode(), S3get_splitpoint(), S3get_sumweights(), S3get_surrogatesplits(), S3get_toleft(), S3get_variableID(), and S3is_ordered().

Referenced by C_get_nodeID(), C_get_nodeweights(), C_get_prediction(), and R_get_node().

Here is the call graph for this function:

SEXP C_get_nodebynum SEXP  subtree,
int  nodenum
 

Get the node with nodeID `nodenum'

Parameters:
subtree a tree
nodenum a nodeID

Definition at line 242 of file Predict.c.

References S3get_leftnode(), S3get_nodeID(), S3get_nodeterminal(), and S3get_rightnode().

Referenced by C_getpredictions(), R_get_nodebynum(), and R_predictRF_weights().

Here is the call graph for this function:

int C_get_nodeID SEXP  subtree,
SEXP  newinputs,
double  mincriterion,
int  numobs
 

Get the nodeID for a new observation

Parameters:
subtree a tree
newinputs an object of class `VariableFrame'
mincriterion overwrites mincriterion used for tree growing
numobs observation number

Definition at line 306 of file Predict.c.

References C_get_node(), and S3get_nodeID().

Referenced by R_get_nodeID(), and R_predictRF_weights().

Here is the call graph for this function:

SEXP C_get_nodeweights SEXP  subtree,
SEXP  newinputs,
double  mincriterion,
int  numobs
 

Get the weights for a new observation

Parameters:
subtree a tree
newinputs an object of class `VariableFrame'
mincriterion overwrites mincriterion used for tree growing
numobs observation number

Definition at line 291 of file Predict.c.

References C_get_node(), and S3get_nodeweights().

Here is the call graph for this function:

SEXP C_get_prediction SEXP  subtree,
SEXP  newinputs,
double  mincriterion,
int  numobs
 

Get the prediction of a new observation

Parameters:
subtree a tree
newinputs an object of class `VariableFrame'
mincriterion overwrites mincriterion used for tree growing
numobs observation number

Definition at line 276 of file Predict.c.

References C_get_node(), and S3get_prediction().

Referenced by C_predict().

Here is the call graph for this function:

void C_getpredictions SEXP  tree,
SEXP  where,
SEXP  ans
 

Get the predictions from `where' nodes

Parameters:
tree a tree
where vector of nodeID's
ans return value

Definition at line 384 of file Predict.c.

References C_get_nodebynum(), and S3get_prediction().

Referenced by R_getpredictions().

Here is the call graph for this function:

void C_predict SEXP  tree,
SEXP  newinputs,
double  mincriterion,
SEXP  ans
 

Get all predictions for `newinputs'

Parameters:
tree a tree
newinputs an object of class `VariableFrame'
mincriterion overwrites mincriterion used for tree growing
ans return value

Definition at line 343 of file Predict.c.

References C_get_prediction(), and get_nobs().

Referenced by R_predict().

Here is the call graph for this function:

void C_splitnode SEXP  node,
SEXP  learnsample,
SEXP  control
 

Split a node according to a splitting rule

Parameters:
node the current node with primary split specified
learnsample learning sample
control an object of class `TreeControl'
Todo:
outplace the splitting since there are at least 3 functions with nearly identical code

Definition at line 21 of file Predict.c.

References C_init_node(), get_maxsurrogate(), get_missings(), get_ninputs(), get_nobs(), get_predict_trafo(), get_splitctrl(), get_variable(), has_missings(), i_in_set(), ncol(), NODE_LENGTH, PL2_inputsSym, PL2_responsesSym, S3_LEFT, S3_RIGHT, S3get_nodeweights(), S3get_primarysplit(), S3get_splitpoint(), S3get_variableID(), and S3is_ordered().

Referenced by C_TreeGrow().

Here is the call graph for this function:

SEXP R_get_node SEXP  subtree,
SEXP  newinputs,
SEXP  mincriterion,
SEXP  numobs
 

R-Interface to C_get_node

Parameters:
subtree a tree
newinputs an object of class `VariableFrame'
mincriterion overwrites mincriterion used for tree growing
numobs observation number

Definition at line 229 of file Predict.c.

References C_get_node().

Here is the call graph for this function:

SEXP R_get_nodebynum SEXP  subtree,
SEXP  nodenum
 

R-Interface to C_get_nodenum

Parameters:
subtree a tree
nodenum a nodeID

Definition at line 263 of file Predict.c.

References C_get_nodebynum().

Here is the call graph for this function:

SEXP R_get_nodeID SEXP  tree,
SEXP  newinputs,
SEXP  mincriterion
 

R-Interface to C_get_nodeID

Parameters:
tree a tree
newinputs an object of class `VariableFrame'
mincriterion overwrites mincriterion used for tree growing

Definition at line 320 of file Predict.c.

References C_get_nodeID(), and get_nobs().

Here is the call graph for this function:

SEXP R_getpredictions SEXP  tree,
SEXP  where
 

R-Interface to C_getpredictions

Parameters:
tree a tree
where vector of nodeID's

Definition at line 405 of file Predict.c.

References C_getpredictions().

Here is the call graph for this function:

SEXP R_predict SEXP  tree,
SEXP  newinputs,
SEXP  mincriterion
 

R-Interface to C_predict

Parameters:
tree a tree
newinputs an object of class `VariableFrame'
mincriterion overwrites mincriterion used for tree growing

Definition at line 364 of file Predict.c.

References C_predict(), and get_nobs().

Here is the call graph for this function:

SEXP R_predictRF_weights SEXP  forest,
SEXP  where,
SEXP  weights,
SEXP  newinputs,
SEXP  mincriterion,
SEXP  oobpred
 

Predictions weights from RandomForest objects

Parameters:
forest a list of trees
where integer matrix (n x ntree) for terminal node numbers
weights double matrix (n x ntree) for bootstrap case weights
newinputs an object of class `VariableFrame'
mincriterion overwrites mincriterion used for tree growing
oobpred a logical indicating out-of-bag predictions

Definition at line 427 of file Predict.c.

References C_get_nodebynum(), C_get_nodeID(), get_nobs(), and S3get_prediction().

Here is the call graph for this function:


Generated on Mon Jul 23 13:18:20 2007 for party by  doxygen 1.4.6