TabularRegressor¶
- class flash.tabular.regression.model.TabularRegressor(parameters, embedding_sizes, cat_dims, num_features, backbone='tabnet', loss_fn=torch.nn.functional.mse_loss, optimizer='Adam', lr_scheduler=None, metrics=None, learning_rate=None, **backbone_kwargs)[source]¶
The
TabularRegressor
is aTask
for classifying tabular data. For more details, see Tabular Classification.- Parameters
parameters¶ (
Dict
[str
,Any
]) – The parameters computed from the training data (can be obtained from theparameters
attribute of theTabularRegressionData
object containing your training data).embedding_sizes¶ (
list
) – List of (num_classes, emb_dim) to form categorical embeddings.cat_dims¶ (
list
) – Number of distinct values for each categorical columnloss_fn¶ (
Callable
) – Loss function for training, defaults to cross entropy.optimizer¶ (
TypeVar
(OPTIMIZER_TYPE
,str
,Callable
,Tuple
[str
,Dict
[str
,Any
]],None
)) – Optimizer to use for training.lr_scheduler¶ (
Optional
[TypeVar
(LR_SCHEDULER_TYPE
,str
,Callable
,Tuple
[str
,Dict
[str
,Any
]],Tuple
[str
,Dict
[str
,Any
],Dict
[str
,Any
]],None
)]) – The LR scheduler to use during training.metrics¶ (
Optional
[TypeVar
(METRICS_TYPE
,Metric
,Mapping
,Sequence
,None
)]) – Metrics to compute for training and evaluation. Can either be an metric from the torchmetrics package, a custom metric inherenting from torchmetrics.Metric, a callable function or a list/dict containing a combination of the aforementioned. In all cases, each metric needs to have the signature metric(preds,target) and return a single scalar tensor. Defaults totorchmetrics.Accuracy
.learning_rate¶ (
Optional
[float
]) – Learning rate to use for training.**backbone_kwargs¶ – Optional additional arguments for the model.
- classmethod available_finetuning_strategies(cls)¶
Returns a list containing the keys of the available Finetuning Strategies.
- classmethod available_lr_schedulers(cls)¶
Returns a list containing the keys of the available LR schedulers.