SAINTClassifier<T>

Models & Types ยท AiDotNet.NeuralNetworks.Tabular

SAINT implementation for classification tasks.

Inheritance: SAINTBase<T> โ†’ SAINTClassifier<T>

For Beginners

Use SAINT for classification when:

  • You have tabular data with mixed numerical and categorical features
  • You believe similar samples in your data share useful patterns
  • You want state-of-the-art performance on tabular classification

Example:

How It Works

SAINTClassifier applies both column attention (over features) and row attention (over samples in a batch) for multi-class classification on tabular data.

Constructors

Constructor Summary
SAINTClassifier(int numNumericalFeatures, int numClasses, SAINTOptions<T> options) Initializes a new instance of the SAINTClassifier class.

Properties

Property Summary
int NumClasses { get; } Gets the number of output classes.

Methods

Method Summary
T ComputeAccuracy(Tensor<T> numericalFeatures, Vector<int> targets, Matrix<int> categoricalIndices) Computes classification accuracy.
T ComputeCrossEntropyLoss(Tensor<T> probabilities, Vector<int> targets) Computes the cross-entropy loss.
T TrainStep(Tensor<T> numericalFeatures, Vector<int> targets, T learningRate, Matrix<int> categoricalIndices) Performs a single training step.
Tensor<T> Forward(Tensor<T> numericalFeatures, Matrix<int> categoricalIndices) Performs the forward pass to get class logits.
Tensor<T> PredictProbabilities(Tensor<T> numericalFeatures, Matrix<int> categoricalIndices) Predicts class probabilities using softmax.
Vector<int> Predict(Tensor<T> numericalFeatures, Matrix<int> categoricalIndices) Predicts the most likely class for each sample.
void ResetState() Resets internal state.
void UpdateParameters(T learningRate) Updates all parameters.