IOnlineClassifier<T>

Interfaces · AiDotNet.Interfaces

Interface for online (incremental) classification models.

Implements: IClassifier<T>

Known implementations: AdaptiveRandomForestClassifier<T>, HoeffdingTreeClassifier<T>, OnlineNaiveBayesClassifier<T>

For Beginners

Online classifiers can learn from data one sample at a time, without needing to retrain from scratch. This is useful for:

  • Streaming data where samples arrive continuously
  • Large datasets that don’t fit in memory
  • Applications requiring real-time adaptation

How It Works

Key differences from batch learning:

  • No need to store all training data
  • Model updates incrementally with each sample
  • Can adapt to concept drift
  • Trade-off: may not achieve same accuracy as batch training

Common online learning algorithms:

  • Hoeffding Tree (Very Fast Decision Tree)
  • Online Naive Bayes
  • Stochastic Gradient Descent
  • Perceptron

Properties

Property Summary
bool IsWarm { get; } Gets whether the model is warm (has seen at least one sample).
long SamplesSeen { get; } Gets the total number of samples the model has seen.

Methods

Method Summary
void PartialFit(Matrix<T> features, Vector<T> labels) Updates the model with a batch of training samples.
void PartialFit(Vector<T> features, T label) Updates the model with a batch of training samples.