xgb.save
From xgboost v0.6.4.1
by Tong He
Save xgboost model to binary file
Save xgboost model from xgboost or xgb.train
Usage
xgb.save(model, fname)
Arguments
- model
the model object.
- fname
the name of the file to write.
Examples
# NOT RUN {
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)
# }
Community examples
Looks like there are no examples yet.