predict method for Node Harvest objects
Given new observations, compute the prediction of a node harvest estimator.
"predict"(object, newdata = NULL, explain = NULL, maxshow = 5, weight = sapply(object[["nodes"]], attr, "weight"), ...)
An object of class
- A data matrix with predictor variables. If missing, the predictions on the training data are returned.
Row numbers for
newdatafor which the predictions should be `explained'. If
NULL, no explanation is given.
- When explaining a prediction, show at most this many nodes (the most important ones).
- Optional changed weight vector for the nodes.
Additional arguments passed to
explains is equal to
NULL, no output is printed.
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
A numeric vector with the predicted response.