Main Page | Directories | File List | File Members | Related Pages

# 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)
void | C_getweights (SEXP tree, SEXP where, SEXP ans)
SEXP | R_getweights (SEXP tree, SEXP where)
void | C_weights (SEXP tree, SEXP newinputs, double mincriterion, SEXP ans)
SEXP | R_weights (SEXP tree, SEXP newinputs, SEXP mincriterion)
SEXP | R_predictRF (SEXP forest, SEXP newinputs, SEXP mincriterion, SEXP oobpred)
SEXP | R_predictRF2 (SEXP forest, SEXP response, SEXP newinputs, SEXP mincriterion, SEXP oobpred)
SEXP | R_predictRF_weights (SEXP forest, SEXP newinputs, SEXP mincriterion, SEXP oobpred)

## Detailed Description

Node splitting and prediction

Author:
  Author
    hothorn

Date:
  Date
    2006-02-08 18:33:26 +0100 (Wed, 08 Feb 2006)

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 122 of file Predict.c. References C_i_in_set(), get_missings(), get_variable(), has_missings(), S3get_leftnode(), S3get_maxcriterion(), S3get_nodeterminal(), S3get_nodeweights(), S3get_primarysplit(), S3get_rightnode(), S3get_splitpoint(), 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 252 of file Predict.c. References S3get_leftnode(), S3get_nodeID(), S3get_nodeterminal(), and S3get_rightnode(). Referenced by C_getpredictions(), C_getweights(), R_get_nodebynum(), R_predictRF(), R_predictRF2(), 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 316 of file Predict.c. References C_get_node(), and S3get_nodeID(). Referenced by R_get_nodeID(), R_predictRF(), R_predictRF2(), 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 301 of file Predict.c. References C_get_node(), and S3get_nodeweights(). Referenced by C_weights(). 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 286 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 394 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_getweights | ( | SEXP | tree,
|  | SEXP | where,
|  | SEXP | ans
| ) |

  | Get the weights from `where' nodes Parameters:
  | tree | a tree
  | where | vector of nodeID's
  | ans | return value
Definition at line 435 of file Predict.c. References C_get_nodebynum(), and S3get_nodeweights(). Referenced by R_getweights(). 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 353 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_splitctrl(), get_variable(), has_missings(), i_in_set(), ncol(), NODE_LENGTH, PL2_inputsSym, PL2_jointtransfSym, 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:

void C_weights | ( | SEXP | tree,
|  | SEXP | newinputs,
|  | double | mincriterion,
|  | SEXP | ans
| ) |

  | Get the weights for all observations in `newinputs' Parameters:
  | tree | a tree
  | newinputs | an object of class `VariableFrame'
  | mincriterion | overwrites mincriterion used for tree growing
  | ans | return value
Definition at line 477 of file Predict.c. References C_get_nodeweights(), and get_nobs(). Referenced by R_weights(). 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 239 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 273 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 330 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 415 of file Predict.c. References C_getpredictions(). Here is the call graph for this function:

SEXP R_getweights | ( | SEXP | tree,
|  | SEXP | where
| ) |

  | R-Interface to C_getweigts Parameters:
  | tree | a tree
  | where | vector of nodeID's
Definition at line 456 of file Predict.c. References C_getweights(). 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 374 of file Predict.c. References C_predict(), and get_nobs(). Here is the call graph for this function:

SEXP R_predictRF | ( | SEXP | forest,
|  | SEXP | newinputs,
|  | SEXP | mincriterion,
|  | SEXP | oobpred
| ) |

  | Predictions from RandomForest objects Parameters:
  | forest | a list of trees
  | newinputs | an object of class `VariableFrame'
  | mincriterion | overwrites mincriterion used for tree growing
  | oobpred | a logical indicating out-of-bag predictions
Definition at line 520 of file Predict.c. References C_get_nodebynum(), C_get_nodeID(), get_nobs(), S3get_nodeweights(), and S3get_prediction(). Here is the call graph for this function:

SEXP R_predictRF2 | ( | SEXP | forest,
|  | SEXP | response,
|  | SEXP | newinputs,
|  | SEXP | mincriterion,
|  | SEXP | oobpred
| ) |

  | Predictions from RandomForest objects, based in total weights Parameters:
  | forest | a list of trees
  | response | a matrix of (transformed) response values
  | newinputs | an object of class `VariableFrame'
  | mincriterion | overwrites mincriterion used for tree growing
  | oobpred | a logical indicating out-of-bag predictions
Definition at line 576 of file Predict.c. References C_get_nodebynum(), C_get_nodeID(), C_matprod(), get_nobs(), ncol(), nrow(), and S3get_nodeweights(). Here is the call graph for this function:

SEXP R_predictRF_weights | ( | SEXP | forest,
|  | SEXP | newinputs,
|  | SEXP | mincriterion,
|  | SEXP | oobpred
| ) |

  | Predictions weights from RandomForest objects Parameters:
  | forest | a list of trees
  | newinputs | an object of class `VariableFrame'
  | mincriterion | overwrites mincriterion used for tree growing
  | oobpred | a logical indicating out-of-bag predictions
Definition at line 641 of file Predict.c. References C_get_nodebynum(), C_get_nodeID(), get_nobs(), S3get_nodeweights(), and S3get_prediction(). Here is the call graph for this function:

SEXP R_weights | ( | SEXP | tree,
|  | SEXP | newinputs,
|  | SEXP | mincriterion
| ) |

  | R-Interface to C_weights Parameters:
  | tree | a tree
  | newinputs | an object of class `VariableFrame'
  | mincriterion | overwrites mincriterion used for tree growing
Definition at line 499 of file Predict.c. References C_weights(), and get_nobs(). Here is the call graph for this function: