Evaluate the GB regressor
Now that the test set predictions are available, you can use them to evaluate the test set Root Mean Squared Error (RMSE) of gb
.
y_test
and predictions y_pred
are available in your workspace.
This exercise is part of the course
Machine Learning with Tree-Based Models in Python
Exercise instructions
Import
mean_squared_error
fromsklearn.metrics
asMSE
.Compute the test set MSE and assign it to
mse_test
.Compute the test set RMSE and assign it to
rmse_test
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Import mean_squared_error as MSE
____
# Compute MSE
mse_test = ____
# Compute RMSE
rmse_test = ____
# Print RMSE
print('Test set RMSE of gb: {:.3f}'.format(rmse_test))