I downloaded data on wine quality and tried to run a regression model to predict the quality, However I did not receive the plot I was expecting. The mean absolute error for the wine quality was approximately 0.5, as a result of this I thought that the True vs predicted value plot would look very similar however I got a graph that Isn't really what I was expecting. Is this what happens when you work with discrete parameters?

As I'm new to this, I was under the impression that this final plot would always resemble your standard linear graph if your predicted and true values were very similar.

Graph obtained

Here is the link to my code if it helps: https://colab.research.google.com/drive/1mxRIx5ufVsA0ljdTpL0Ud0qm2y39eyGX

  • $\begingroup$ Despite the Quality variable having numeric values, it is not really a numeric variable. It is an ordinal variable. On a 10-point qualitative scale, the different between a 4 and a 5 might not be the same absolute difference as between a 7 and an 8. This is a classification problem in disguise. Peter's answer provides a suggestion to try a different regression method appropriate to classification problems. $\endgroup$
    – Ben Norris
    Commented Jun 18, 2020 at 20:26

1 Answer 1


The true quality is 4,5,6... the predicted quality deviates from the true one. This deviation is expressed by the variation of the dots on the x axis. The line in the plot shows, that there is positive correlation between your prediction and true states (which is good and expected).

Think about the magnitude of mae 0.5 in your case. Means „half a class wrong“. You likely have some concentration of predicted values around the true value (not good to spot in such a figure) and some outliers, viz relatively bad predictions, which are far away from the true class. You can also see that your prediction is bad for low and high classes.

I guess this is a linear regression? Try multinominal logit or the like. In you linear regression the prediction can be any rational number. What you would like to have as a prediction is a class, so 4,5,6 or whatever the class is called.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.