XGBoost Basics
Explore the essentials of using XGBoost for machine learning by understanding its core data structure, the DMatrix, and how to train and evaluate Booster objects. This lesson helps you implement gradient boosted decision trees for multiclass classification with practical coding exercises.
We'll cover the following...
We'll cover the following...
Chapter Goals:
- Learn about the XGBoost data matrix
- Train a
Boosterobject in XGBoost
A. Basic data structures
The basic data structure for XGBoost is the DMatrix, which represents a data matrix. The DMatrix can be constructed from NumPy arrays.
The code below creates DMatrix objects with and without labels.
The DMatrix object can be used for training and using a ...