Menu

Evaluating Model Performance

Evaluating Model Performance

Evaluate prediction quality using regression metrics.

Mean Absolute Error (MAE)

mae = mean_absolute_error(
Y_test,
predictions
)
print(mae)

Mean Squared Error (MSE)

mse = mean_squared_error(
Y_test,
predictions
)
print(mse)

Root Mean Squared Error (RMSE)

rmse = np.sqrt(mse)
print(rmse)

R² Score

r2 = r2_score(
Y_test,
predictions
)
print(r2)

Explanation

These metrics help measure:

  • Average prediction error
  • Overall prediction accuracy
  • Model reliability

Lower MAE, MSE, and RMSE indicate better predictions, while an R² Score closer to 1 indicates stronger model performance.