AI, Machine Learning, Python, Data Science, Artificial Intelligence.
assess the model’s performance. from sklearn.metrics import mean_absolute_error, r2_score mae = mean_absolute_error(y_test, y_pred) r2 = r2_score(y_test, y_pred) print(f"Mean Absolute Error: {mae:.2f}") print(f"R-squared Score: {r2:.2f}") Output: Mean Absolute Error: 20.00 R-squared Score: 0.99 The