Skip to contents

High Level Interface

High level XGBoost interface

xgboost()
Fit XGBoost Model
predict(<xgboost>)
Compute predictions from XGBoost model on new data
print(<xgboost>)
Print info from XGBoost model

Datasets

Test datasets bundled with the R package.

agaricus.train
Training part from Mushroom Data Set
agaricus.test
Test part from Mushroom Data Set

Global Configuration

Global configuration for the XGBoost library.

xgb.config() `xgb.config<-`()
Accessors for model parameters as JSON string
xgb.set.config() xgb.get.config()
Set and get global configuration

DMatrix

Low-level data storage.

xgb.DMatrix() xgb.QuantileDMatrix()
Construct xgb.DMatrix object
xgb.DMatrix.hasinfo()
Check whether DMatrix object has a field
xgb.DMatrix.save()
Save xgb.DMatrix object to binary file
dim(<xgb.DMatrix>)
Dimensions of xgb.DMatrix
dimnames(<xgb.DMatrix>) `dimnames<-`(<xgb.DMatrix>)
Handling of column names of xgb.DMatrix
print(<xgb.DMatrix>)
Print xgb.DMatrix
xgb.DataBatch()
Structure for Data Batches
xgb.DataIter()
XGBoost Data Iterator
xgb.get.DMatrix.data()
Get DMatrix Data
xgb.get.DMatrix.num.non.missing()
Get Number of Non-Missing Entries in DMatrix
xgb.ExtMemDMatrix()
DMatrix from External Data
xgb.QuantileDMatrix.from_iterator()
QuantileDMatrix from External Data
xgb.get.DMatrix.qcut()
Get Quantile Cuts from DMatrix
xgb.slice.DMatrix() `[`(<xgb.DMatrix>)
Slice DMatrix

Booster

The model for XGBoost.

a-compatibility-note-for-saveRDS-save
Model Serialization and Compatibility
coef(<xgb.Booster>)
Extract coefficients from linear booster
getinfo() setinfo()
Get or set information of xgb.DMatrix and xgb.Booster objects
predict(<xgb.Booster>)
Predict method for XGBoost model
print(<xgb.Booster>)
Print xgb.Booster
xgb.load()
Load XGBoost model from binary file
xgb.load.raw()
Load serialised XGBoost model from R's raw vector
xgb.save()
Save XGBoost model to binary file
xgb.save.raw()
Save XGBoost model to R's raw vector
xgb.copy.Booster()
Deep-copies a Booster Object
xgb.slice.Booster() `[`(<xgb.Booster>)
Slice Booster by Rounds
xgb.get.num.boosted.rounds() length(<xgb.Booster>)
Get number of boosting in a fitted booster
xgb.is.same.Booster()
Check if two boosters share the same C object
xgb.importance()
Feature importance
xgb.attr() `xgb.attr<-`() xgb.attributes() `xgb.attributes<-`()
Accessors for serializable attributes of a model
xgb.create.features()
Create new features from a previously learned model
xgb.model.dt.tree()
Parse model text dump
`xgb.model.parameters<-`()
Accessors for model parameters
xgb.ggplot.deepness() xgb.plot.deepness()
Plot model tree depth
xgb.dump()
Dump an XGBoost model in text format.
variable.names(<xgb.Booster>)
Get Features Names from Booster
xgb.ggplot.importance() xgb.plot.importance()
Plot feature importance
xgb.plot.multi.trees()
Project all trees on one tree
xgb.plot.shap()
SHAP dependence plots
xgb.ggplot.shap.summary() xgb.plot.shap.summary()
SHAP summary plot
xgb.plot.tree()
Plot boosted trees
xgb.gblinear.history()
Extract gblinear coefficients history

Training Callbacks

Callback functions used for training.

xgb.Callback()
XGBoost Callback Constructor
xgb.cb.cv.predict()
Callback for returning cross-validation based predictions
xgb.cb.early.stop()
Callback to activate early stopping
xgb.cb.evaluation.log()
Callback for logging the evaluation history
xgb.cb.gblinear.history()
Callback for collecting coefficients history of a gblinear booster
xgb.cb.print.evaluation()
Callback for printing the result of evaluation
xgb.cb.reset.parameters()
Callback for resetting booster parameters at each iteration
xgb.cb.save.model()
Callback for saving a model file

Low-level Training Functions

Low-level Training Functions with DMatrix and Booster

xgb.params()
XGBoost Parameters
xgb.train()
Fit XGBoost Model
xgb.cv()
Cross Validation
print(<xgb.cv.synchronous>)
Print xgb.cv result

Deprecation Settings

xgboost-options
XGBoost Options