predict.nodeHarvest {nodeHarvest} | R Documentation |
Given new observations, compute the prediction of a node harvest estimator.
## S3 method for class 'nodeHarvest': predict(object, newdata = NULL, explain = 1, maxshow = 5, weight = sapply(object[["nodes"]], attr, "weight"), ...)
object |
An object of class nodeHarvest .
|
newdata |
A data matrix with predictor variables. If missing, the predictions on the training data are returned. |
explain |
Row numbers for newdata for which the predictions should be `explained'.
If NULL , no explanation is given.
|
maxshow |
When explaining a prediction, show at most this many nodes (the most important ones). |
weight |
Optional changed weight vector for the nodes. |
... |
Additional arguments passed to predict
|
If explains
is equal to NULL
, no output is printed.
If explain
is a numeric vector (with values in 1 to the number of samples in newdata
), for each observation in newdata
with a sample number in vector explain
, the following is done:
all nodes that the observation belongs to are printed on screen, along with their node mean (the mean of all training observations who fell into this node) and weight. The prediction for this new observation is the weighted average across these node means. The number of nodes show is given in descending order of their importance (weight) and the number of nodes shown is limited to maxshow
.
A numeric vector with the predicted response.
Nicolai Meinshausen meinshausen@stats.ox.ac.uk
http://www.stats.ox.ac.uk/~meinshau