Learn R Programming

BigTSP (version 1.0)

predict.tsp.gbm: prediction function for tsp.gbm

Description

prediction function for tsp.gbm

Usage

"predict"(object, newdata, n.trees, type = "link", single.tree = FALSE, ...)

Arguments

object
a tsp.gbm object
newdata
new data matrix
n.trees
Number of trees used in the prediction. n.trees may be a vector in which case predictions are returned for each iteration specified
type
The scale on which gbm makes the predictions
single.tree
If single.tree=TRUE then predict.tsp.gbm returns only the predictions from tree(s) n.trees
...
not used.

References

gbm package

Examples

Run this code
library(gbm)
x=matrix(rnorm(100*20),100,20)
y=rbinom(100,1,0.5)
fit=tsp.gbm(x,y)
predict(fit,x[1:10,],n.trees=5)

Run the code above in your browser using DataLab