IOrdinalClassifier<T>

Interfaces · AiDotNet.Interfaces

Interface for ordinal classification (ordinal regression) models.

Implements: IClassifier<T>

Known implementations: OrdinalClassifierBase<T>

For Beginners

Ordinal classification handles categories with a natural order, like ratings (1-5 stars), education levels, or pain severity. Unlike regular classification, the order matters - predicting 5 stars when true is 4 stars is better than predicting 1 star.

How It Works

Key differences from regular classification:

  • Classes have a natural ordering (1 < 2 < 3 < …)
  • Errors near the true class are less severe than distant errors
  • Models often use cumulative probabilities P(Y ≤ k)

Common approaches:

  • Threshold models: Learn thresholds that separate ordered classes
  • Proportional odds: Ordinal logistic regression
  • Regression-based: Treat ordinal as continuous, round predictions

Properties

Property Summary
Vector<T> OrderedClasses { get; } Gets the ordered class labels from lowest to highest.

Methods

Method Summary
Matrix<T> PredictCumulativeProbabilities(Matrix<T> features) Predicts cumulative probabilities P(Y ≤ k) for each class threshold.
Vector<T> Predict(Matrix<T> features) Predicts ordinal class labels.