Menu

Making Predictions Using the Trained Model

Making Predictions Using the Trained Model

After training, the model is ready to predict house prices.

The first step is generating predictions on the training dataset.

Code

**y_train_pred = model.predict(X_train)**

**print(len(y_train_pred))**

Explanation

The predict() function uses the trained XGBoost model to estimate house prices based on the input features.

The output contains predicted prices for every record in the training dataset.

At this stage, we can compare these predictions with the actual house prices to measure performance.