Model diagnostics
So far, you have seen some metrics such as R2 and RMSE to measure model performance. Also, graphical methods have been introduced to inspect the errors in predictions (the residuals). In addition to what you've learned by plotting residuals to investigate the quality of a model, in regression, there are a couple more powerful and important methods you can use.
Comparing predicted and actual values
In Figure 11.15, the prediction using simple linear regression was plotted on the same time series chart as the data. While this is very informative, another way to look at the model is to plot the predicted values versus the actual ones. In such a plot, if the scales are the same for x
and y
, then "perfect" predictions lie on a diagonal line. This makes it easy to see by inspection if there are trends at, for example, low or high values.
Here, the predictions for the linear model (using the log-transformed data) and the Random Forest model are...