xgboost (version 0.3-0)

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, to make it look nice, run demo/demo.R for result and demo/featmap.txt for example Format: https://github.com/tqchen/xgboost/wiki/Binary-Classification#dump-model

Examples

Run this code
data(iris)
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]), nrounds = 2)
xgb.dump(bst, 'iris.xgb.model.dump')

Run the code above in your browser using DataLab