-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
Description
Describe 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