GANDALFClassifier<T>
Models & Types ยท AiDotNet.NeuralNetworks.Tabular
GANDALF implementation for classification tasks.
Inheritance: GANDALFBase<T> โ GANDALFClassifier<T>
For Beginners
Use GANDALF for classification when you want:
- Automatic feature importance learning
- Interpretable predictions (can see feature weights and tree paths)
- Good performance on tabular data
Example:
How It Works
GANDALFClassifier uses gated feature selection with neural decision trees for multi-class classification. The additive ensemble of trees produces class logits that are converted to probabilities via softmax.
Constructors
| Constructor | Summary |
|---|---|
GANDALFClassifier(int numFeatures, int numClasses, GANDALFOptions<T> options) |
Initializes a new instance of the GANDALFClassifier class. |
Properties
| Property | Summary |
|---|---|
int NumClasses { get; } |
Gets the number of output classes. |
Methods
| Method | Summary |
|---|---|
T ComputeAccuracy(Tensor<T> features, Vector<int> targets) |
Computes classification accuracy. |
T ComputeCrossEntropyLoss(Tensor<T> probabilities, Vector<int> targets) |
Computes the cross-entropy loss. |
T TrainStep(Tensor<T> features, Vector<int> targets, T learningRate) |
Performs a single training step. |
Tensor<T> Forward(Tensor<T> features) |
Performs the forward pass to get class logits. |
Tensor<T> PredictProbabilities(Tensor<T> features) |
Predicts class probabilities using softmax. |
Vector<int> Predict(Tensor<T> features) |
Predicts the most likely class for each sample. |
void ResetState() |
Resets internal state. |
void UpdateParameters(T learningRate) |
Updates all parameters. |