Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

print.gbm

Print model summary


Description

Display basic information about a gbm object.

Usage

## S3 method for class 'gbm'
print(x, ...)

show.gbm(x, ...)

Arguments

x

an object of class gbm.

...

arguments passed to print.default.

Details

Prints some information about the model object. In particular, this method prints the call to gbm(), the type of loss function that was used, and the total number of iterations.

If cross-validation was performed, the 'best' number of trees as estimated by cross-validation error is displayed. If a test set was used, the 'best' number of trees as estimated by the test set error is displayed.

The number of available predictors, and the number of those having non-zero influence on predictions is given (which might be interesting in data mining applications).

If multinomial, bernoulli or adaboost was used, the confusion matrix and prediction accuracy are printed (objects being allocated to the class with highest probability for multinomial and bernoulli). These classifications are performed on the entire training data using the model with the 'best' number of trees as described above, or the maximum number of trees if the 'best' cannot be computed.

If the 'distribution' was specified as gaussian, laplace, quantile or t-distribution, a summary of the residuals is displayed. The residuals are for the training data with the model at the 'best' number of trees, as described above, or the maximum number of trees if the 'best' cannot be computed.

Author(s)

Harry Southworth, Daniel Edwards

See Also

Examples

data(iris)
iris.mod <- gbm(Species ~ ., distribution="multinomial", data=iris,
                 n.trees=2000, shrinkage=0.01, cv.folds=5,
                 verbose=FALSE, n.cores=1)
iris.mod
#data(lung)
#lung.mod <- gbm(Surv(time, status) ~ ., distribution="coxph", data=lung,
#                 n.trees=2000, shrinkage=0.01, cv.folds=5,verbose =FALSE)
#lung.mod

gbm

Generalized Boosted Regression Models

v2.1.8
GPL (>= 2) | file LICENSE
Authors
Brandon Greenwell [aut, cre] (<https://orcid.org/0000-0002-8120-0084>), Bradley Boehmke [aut] (<https://orcid.org/0000-0002-3611-8516>), Jay Cunningham [aut], GBM Developers [aut] (https://github.com/gbm-developers)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.