Support for ordinal multi-classification
See original GitHub issueDescribe the workflow you want to enable
Encode response variable ordering with every scikit learn classifier according to the method introduced in this frequently cited paper.
Describe your proposed solution
Implement OrdinalClassifier
, a classifier that takes another scikit learn classifier as input and encodes the ordinality assumption into the classifier. It’s quite simple, and there are also blog posts on it, for example by @M46F here. Here’s a slightly more advanced version that can also handle arbitrary labels that I’d be willing to contribute as a PR: https://gist.github.com/lorenzwalthert/51371894225c7b530b66bdabfad60327
A lot of classification problems are inherently ordinal in nature and this trick has proven to work well in various settings, the code is very little to add to the project, adds zero dependencies and is a much cited approach (600+).
Describe alternatives you’ve considered, if relevant
Using that code outside of scikit learn, but I think ti’s generally useful to others.
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:7 (3 by maintainers)
Top GitHub Comments
Ok. But I don’t think that’s a big problem. We can just normalize the probability, no?
Also. here is some other related work: https://github.com/leeprevost/OrdinalClassifier
I’ve checked the link that you share, I think it has a better implementation than the one that I provide in the medium post