3
$\begingroup$

Lets say that based on some user available ratings i want to predict the ratings of unrated products for some specific user. I totally understand the fact that classifier models are for categorical data and regression models for continuous but in that case should we treat ratings as categorical values? I am searching in bibliography papers and some use classification to predict ratings and others regression.

$\endgroup$

1 Answer 1

6
+50
$\begingroup$

TL;DR: Use (ordinal) regression. Your problem lies somewhere between standard regression and classification, but doing standard regression is less "wrong" than doing classification.

In detail: I assume that the ratings are integers, like $\{1, 2, 3, 4, 5\}$, and that one extreme (e.g. 1) means "bad" and the other (5) "excellent". I.e. there is an order in the ratings: 5 is better than 4, 4 is better than 3 etc. Variables of that kind are called "ordinal". They differ from continuous variables in that the difference between values cannot be translated to difference in the underlying property. For example, you cannot say that the product with rating 5 is exactly as much better from the product with rating 4, as is the product with rating 4 from the product with rating 3, etc.

Applying classification here would lead to a substantial loss of information and poor performance. A standard classifier wouldn't know that ratings 4 and 5 are more similar than ratings 1 and 5. For a classifier, they are either identical or different.

A common approach to solving such problems is to assume a latent continuous variable which represents the true product quality, and the rating as an observable, rounded, and possibly non-linear function of that true quality. Something like in the figure below:

latent to ordinal

There are methods to deal explicitly with such problems, like the proportional odds model, neural networks for ordinal regression, or support vector machines. If this sounds too complicated, using ordinary regression, while suboptimal, is still better than classification.

For available software libraries, you may consult this (somewhat old) answer on StackOverflow.

$\endgroup$
4
  • $\begingroup$ So in practice can i use a random forest regressor to train and predict recommendations rather than random forest classifier? $\endgroup$
    – mpountou
    Commented Jan 8, 2021 at 10:08
  • $\begingroup$ Yes. It would be even better if you could find a random forest ordinal regressor, but I'm not aware of its existence. $\endgroup$
    – Igor F.
    Commented Jan 8, 2021 at 10:09
  • $\begingroup$ Nice thank you for your answer. In my recommender random forest regressor works much better than classifier even though i can't find in bibliography papers anyone using random forest regressors. This fact scared me at first $\endgroup$
    – mpountou
    Commented Jan 9, 2021 at 15:20
  • $\begingroup$ I'm glad I could help. $\endgroup$
    – Igor F.
    Commented Jan 9, 2021 at 19:08

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.