IMultiLabelClassifier<T>

Interfaces · AiDotNet.Interfaces

Interface for multi-label classification models.

Implements: IFeatureAware, IFullModel<T, Matrix<T>, Matrix<T>>, IGradientComputable<T, Matrix<T>, Matrix<T>>

Known implementations: MultiLabelClassifierBase<T>

For Beginners

Multi-label classification assigns multiple labels to each sample, unlike traditional classification which assigns exactly one label. For example, a news article might be tagged with both “politics” and “economy”.

How It Works

Key differences from multi-class classification:

  • Each sample can have zero, one, or multiple labels
  • Labels are not mutually exclusive
  • Output is a binary indicator matrix (1 = label present, 0 = absent)

Common approaches:

  • Problem Transformation: Convert to multiple binary problems (Binary Relevance, Classifier Chains)
  • Algorithm Adaptation: Adapt algorithms to handle multiple labels (ML-kNN, RAkEL)

Properties

Property Summary
int NumLabels { get; } Gets the number of possible labels.
string[] LabelNames { get; } Gets the label names if available.

Methods

Method Summary
Matrix<T> Predict(Matrix<T> features) Predicts binary label indicators for input samples.
Matrix<T> PredictProbabilities(Matrix<T> features) Predicts label probabilities for input samples.
void Train(Matrix<T> features, Matrix<T> labels) Trains the multi-label classifier.