July 2018
Beginner to intermediate
146 pages
3h 39m
English
We know from Chapter 5, Getting Started with Data Mining Techniques that the RMSE, or root mean squared error, is the most commonly used performance metric for regressors. We will be using the RMSE to assess our modeling performance too. scikit-learn already gives us an implementation of the mean squared error. So, all that we have to do is define a function that returns the square root of the value returned by mean_squared_error:
#Import the mean_squared_error functionfrom sklearn.metrics import mean_squared_error#Function that computes the root mean squared error (or RMSE)def rmse(y_true, y_pred): return np.sqrt(mean_squared_error(y_true, y_pred))
Next, let's define our baseline collaborative filter model. All our collaborative ...
Read now
Unlock full access