Menu

Visualizing Actual vs Predicted Prices

Visualizing Actual vs Predicted Prices

Numerical metrics provide valuable information, but visualizations offer an intuitive understanding of model performance.

Code

**plt.scatter(**

**y_train,**

**y_train_pred**

**)**

**plt.xlabel(**

**"Actual Prices"**

**)**

**plt.ylabel(**

**"Predicted Prices"**

**)**

**plt.title(**

**"Actual Prices vs Predicted Prices"**

**)**

**plt.show()**

Explanation

This scatter plot compares:

  • Actual house prices
  • Predicted house prices

If the model performs well, most points should appear close to an imaginary diagonal line.

The closer the points are to the diagonal, the more accurate the predictions.