ProbabilisticClassifierBase<T>

Base Classes · AiDotNet.Classification

Provides a base implementation for probabilistic classification algorithms that output class probability estimates.

Inheritance: ClassifierBase<T> → ProbabilisticClassifierBase<T>

Implements: IProbabilisticClassifier<T>

Known derived types: CalibratedClassifier<T>, DecisionTreeClassifier<T>, EnsembleClassifierBase<T>, KNeighborsClassifier<T>, LinearClassifierBase<T>, LinearDiscriminantAnalysis<T>, MetaClassifierBase<T>, NaiveBayesBase<T>, QuadraticDiscriminantAnalysis<T>, SVMBase<T>

For Beginners

Probabilistic classifiers don’t just say “this is category A” - they tell you how confident they are. For example, instead of just “spam”, they might say “92% spam, 8% not spam.”

This additional information is valuable because:

  • You can see when the model is uncertain (close to 50%/50%)
  • You can adjust the decision threshold for your specific needs
  • You can combine predictions from multiple models more effectively

How It Works

This abstract class extends ClassifierBase to add probabilistic prediction capabilities. Probabilistic classifiers can output not just the predicted class, but also the probability of each class. This is useful for understanding model confidence and making threshold-based decisions.

The default Predict() method uses argmax of the probabilities to determine the class.

Methods

Method Summary
Matrix<T> PredictLogProbabilities(Matrix<T> input) Predicts log-probabilities for each class.
Matrix<T> PredictProbabilities(Matrix<T> input) Predicts class probabilities for each sample in the input.
ModelMetadata<T> GetModelMetadata()
Vector<T> Predict(Matrix<T> input) Predicts class labels for the given input data by taking the argmax of probabilities.