predict-Deepboost-method: Predict method for Deepboost model

Description Usage Arguments Details Examples

Description

Predicted values based on deepboost model object.

Usage

1
2
## S4 method for signature 'Deepboost'
predict(object, newdata, type = "terms")

Arguments

object

Object of class "Deepboost"

newdata

takes data.frame.

type

Type of prediction

Details

The option ntreelimit purpose is to let the user train a model with lots of trees but use only the first trees for prediction to avoid overfitting (without having to train a new model with less trees).

Examples

1
2
3
4
dpb <- deepboost(y ~ .,
 data.frame(x1=rep(c(0,0,1,1),2),x2=rep(c(0,1,0,1),2),y=factor(rep(c(0,0,0,1),2))),
 num_iter=2,tree_depth=2)
predict(dpb,data.frame(x1=rep(c(1,1,1,0),2),x2=rep(c(1,1,1,1),2)))

Example output

Iteration: 1, error: 0.25, avg tree size: 1, num trees: 1
Iteration: 2, error: 0, avg tree size: 3, num trees: 2
[1] "1" "1" "1" "0" "1" "1" "1" "0"

deepboost documentation built on May 2, 2019, 8:35 a.m.