# Understanding Residuals in yellowbrick

I have a problem understanding the residual plot from yellowbrick. I have created the following plots:

If I take a look at the first one: It shows the predicted value on the $$y$$-axis and the real value on the $$x$$-axis. That means in this case, that some of my predicted values are too low, correct?

If I now take a look at the residual plot: As far as I know the residuals value is calculated with: $$\text{residual} = y_\text{real} - y_\text{predicted}$$

This would mean that a negative residual value would express that some of my predicted values are too high, correct?

How can this correlate? This seems to be the inversed message compared to the first plot? What is wrong in this case? Do I have to invert the residuals calculation?

Thank you in advance Lukas

• You have it backwards: the residual is obtained by subtracting the "real" value from the prediction. The two plots clearly show this.
– whuber
Feb 1, 2021 at 16:36
• What is "yellowbrick" & what does it have to do with your question? Feb 1, 2021 at 16:42
• With regard to the first plot the plot shows that you have too low predicted values in some cases and too high predicted values in others. Feb 1, 2021 at 19:06
• @whuber, our excerpt & wiki for the residuals tag discuss $y-\hat y$. The discussion on the wikipedia page here implies the same thing. Feb 1, 2021 at 22:07
• @gung You're right--sorry.
– whuber
Feb 1, 2021 at 22:33