xgb.load {xgboost}R Documentation

Load xgboost model from binary file

Description

Load xgboost model from the binary model file

Usage

xgb.load(modelfile)

Arguments

modelfile

the name of the binary file.

Examples

data(agaricus.train, package='xgboost')
data(agaricus.test, package='xgboost')
train <- agaricus.train
test <- agaricus.test
bst <- xgboost(data = train$data, label = train$label, max_depth = 2, 
               eta = 1, nthread = 2, nrounds = 2,objective = "binary:logistic")
xgb.save(bst, 'xgb.model')
bst <- xgb.load('xgb.model')
pred <- predict(bst, test$data)

[Package xgboost version 0.6-0 Index]