Menu

Importing the XGBoost Regressor

Importing the XGBoost Regressor

Before training the model, we must import the XGBoost library.

Code

**from xgboost import XGBRegressor**

Explanation

The XGBRegressor class provides all the functionality needed to build a regression model using the XGBoost algorithm.

Once imported, we can create and train the model using the housing dataset.