xgboost (version 0.3-1)

xgb.dump: Save xgboost model to text file

Description

Save a xgboost model to text file. Could be parsed later.

Usage

xgb.dump(model, fname, fmap = "")

Arguments

model
the model object.
fname
the name of the binary file.
fmap
feature map file representing the type of feature. Detailed description could be found at https://github.com/tqchen/xgboost/wiki/Binary-Classification#dump-model. See demo/ for walkthrough example in R, and http

Examples

Run this code
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, nround = 2,objective = "binary:logistic")
xgb.dump(bst, 'xgb.model.dump')

Run the code above in your browser using DataCamp Workspace