Session Ready
Exercise

Predict bike rentals with the random forest model

In this exercise you will use the model that you fit in the previous exercise to predict bike rentals for the month of August.

The predict() function for a ranger model produces a list. One of the elements of this list is predictions, a vector of predicted values. You can access predictions with the $ notation for accessing named elements of a list:

predict(model, data)$predictions

Instructions
100 XP

The model bike_model_rf and the dataset bikesAugust (for evaluation) are loaded into your workspace.

  • Call predict() on bikesAugust to predict the number of bikes rented in August (cnt). Add the predictions to bikesAugust as the column pred.
  • Fill in the blanks to calculate the root mean squared error of the predictions.
    • The poisson model you built for this data gave an RMSE of about 112.6. How does this model compare?
  • Fill in the blanks to plot actual bike rental counts (cnt) versus the predictions (pred on x-axis).