predict.nodeHarvest: predict method for Node Harvest objects

Description Usage Arguments Details Value Author(s) See Also

View source: R/predict.nodeHarvest.R

Description

Given new observations, compute the prediction of a node harvest estimator.

Usage

1
2
3
4
## S3 method for class 'nodeHarvest'
predict(object, newdata = NULL, explain = NULL, 
                maxshow = 5, 
                weight = sapply(object[["nodes"]], attr, "weight"), ...)

Arguments

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

Details

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.

Value

A numeric vector with the predicted response.

Author(s)

Nicolai Meinshausen meinshausen@stats.ox.ac.uk

http://www.stats.ox.ac.uk/~meinshau

See Also

nodeHarvest, plot.nodeHarvest


nodeHarvest documentation built on May 2, 2019, 2:45 a.m.