SemiSupervisedClassifierBase<T>

Base Classes · AiDotNet.Classification.SemiSupervised

Provides a base implementation for semi-supervised classification algorithms.

Inheritance: ClassifierBase<T> → SemiSupervisedClassifierBase<T>

Implements: ISemiSupervisedClassifier<T>

Known derived types: LabelPropagation<T>, LabelSpreading<T>, SelfTrainingClassifier<T>

For Beginners

This base class provides the foundation for building classifiers that can learn from both labeled data (where you know the answers) and unlabeled data (where you don’t).

Think of it like a student learning with two types of study materials:

  • A teacher’s answer key (labeled data) - few examples but definitely correct
  • Practice problems without answers (unlabeled data) - many examples to learn patterns from

By combining both, the student (classifier) can learn more effectively than using just the answer key alone.

How It Works

This abstract class extends ClassifierBase with semi-supervised learning capabilities, allowing derived classes to leverage both labeled and unlabeled data during training.

Properties

Property Summary
int NumLabeledSamples { get; set; } Gets or sets the number of labeled samples used in training.
int NumUnlabeledSamples { get; set; } Gets or sets the number of unlabeled samples used in training.

Methods

Method Summary
Vector<T> GetPseudoLabelConfidences() Gets the confidence scores for the pseudo-labels.
Vector<T> GetPseudoLabels() Gets the pseudo-labels assigned to the unlabeled data during training.
void Train(Matrix<T> x, Vector<T> y) Trains the classifier using only labeled data (standard supervised training).
void TrainSemiSupervised(Matrix<T> labeledX, Vector<T> labeledY, Matrix<T> unlabeledX) Trains the classifier using both labeled and unlabeled data.