Skip to content

Latest commit

 

History

History
48 lines (25 loc) · 1.14 KB

readme.md

File metadata and controls

48 lines (25 loc) · 1.14 KB

Ordinal Classification/Regression

Turn your favourite classifier into an ordinal classifier.

Ordinal classification packages where every sklearn classifier is supported.

You need to have more than 2 labels for your features obviously!

The classification is based upon this paper over here:

[1] https://dl.acm.org/doi/10.1007/3-540-44795-4_13

!git clone https://github.com/mosh98/Ordinal_Classifier.git

Not yet on PyPI — install by cloning the repo

How do i use it?

  1. import your favourite classifier from sklearn
  2. Insert that clf into the OrdinalClassifier
  3. Call fit and predict on your data

Here is an example: Open in Colab

from Ordinal_Classifier import Ordinal_Classifier as OC
from sklearn.tree import DecisionTreeClassifier

clf = OC.OrdinalClassifier(DecisionTreeClassifier())

clf.fit(X_train, y_train)
  
predictions = clf.predict(X_test)

# TADA! You just became a regression master! 

Please pull an issue if you find any bugs

Enjoy!!