TabNetRegression<T>

Models & Types · AiDotNet.NeuralNetworks.Tabular

TabNet implementation for regression tasks.

Inheritance: TabNetBase<T> → TabNetRegression<T>

For Beginners

Use TabNetRegression when you want to predict a number (continuous value) from tabular data.

Example use cases:

  • Predicting house prices from features like square footage, bedrooms, location
  • Forecasting sales based on historical data and market indicators
  • Estimating customer lifetime value from demographic and behavioral data

Key features:

  • Automatic Feature Selection: Learns which columns in your data matter most
  • Interpretability: You can see exactly which features the model used
  • No Feature Engineering: Often works well without manual feature preprocessing
  • Competitive Performance: Matches or beats gradient boosting methods

Basic usage:

How It Works

TabNetRegression extends the TabNet architecture for predicting continuous values. It uses the same attention-based feature selection mechanism but with an output layer suitable for regression.

Reference: “TabNet: Attentive Interpretable Tabular Learning” (Arik & Pfister, AAAI 2021)

Constructors

Constructor Summary
TabNetRegression(int inputFeatures, TabNetOptions<T> options) Initializes a new instance of the TabNetRegression class for single-output regression.
TabNetRegression(int inputFeatures, int outputTargets, TabNetOptions<T> options) Initializes a new instance of the TabNetRegression class for multi-output regression.

Methods

Method Summary
T ComputeMAELoss(Tensor<T> predictions, Tensor<T> targets) Computes the Mean Absolute Error (MAE) loss.
T ComputeMSELoss(Tensor<T> predictions, Tensor<T> targets) Computes the Mean Squared Error (MSE) loss.
T ComputeR2Score(Tensor<T> predictions, Tensor<T> targets) Computes the R² (coefficient of determination) score.
T ComputeTotalLoss(Tensor<T> predictions, Tensor<T> targets) Computes the total loss including sparsity regularization.
T TrainStep(Tensor<T> input, Tensor<T> targets, T learningRate) Performs a single training step.
Tensor<T> ComputeMSEGradient(Tensor<T> predictions, Tensor<T> targets) Computes the gradient of MSE loss for backpropagation.
Tensor<T> Predict(Tensor<T> input) Performs prediction for regression.