class_docstr: The ``TabularClassifier`` is a :class:`~flash.Task` for classifying tabular data. For more details, see
  :ref:`tabular_classification`.
  
  Args:
      parameters: The parameters computed from the training data (can be obtained from the ``parameters`` attribute of
          the ``TabularClassificationData`` object containing your training data).
      embedding_sizes: List of (num_classes, emb_dim) to form categorical embeddings.
      cat_dims: Number of distinct values for each categorical column
      num_features: Number of columns in table
      num_classes: Number of classes to classify
      backbone: name of the model to use
      loss_fn: Loss function for training, defaults to cross entropy.
      optimizer: Optimizer to use for training.
      lr_scheduler: The LR scheduler to use during training.
      metrics: 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 to :class:`torchmetrics.Accuracy`.
      learning_rate: Learning rate to use for training.
      **backbone_kwargs: Optional additional arguments for the model.
class_docstr_tok: ["The","``","TabularClassifier","``","is","a",":","class",":","`","~flash.Task","`","for","classifying","tabular","data",".","For","more","details",",","see",":","ref",":","`","tabular_classification","`",".","Args",":","parameters",":","The","parameters","computed","from","the","training","data","(","can","be","obtained","from","the","``","parameters","``","attribute","of","the","``","TabularClassificationData","``","object","containing","your","training","data",")",".","embedding_sizes",":","List","of","(","num_classes",",","emb_dim",")","to","form","categorical","embeddings",".","cat_dims",":","Number","of","distinct","values","for","each","categorical","column","num_features",":","Number","of","columns","in","table","num_classes",":","Number","of","classes","to","classify","backbone",":","name","of","the","model","to","use","loss_fn",":","Loss","function","for","training",",","defaults","to","cross","entropy",".","optimizer",":","Optimizer","to","use","for","training",".","lr_scheduler",":","The","LR","scheduler","to","use","during","training",".","metrics",":","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","to",":","class",":","`","torchmetrics.Accuracy","`",".","learning_rate",":","Learning","rate","to","use","for","training",".","*","*","backbone_kwargs",":","Optional","additional","arguments","for","the","model","."]
code: def from_data(cls, datamodule, **kwargs) -> "TabularClassifier":
      return cls(
          parameters=datamodule.parameters,
          embedding_sizes=datamodule.embedding_sizes,
          cat_dims=datamodule.cat_dims,
          num_features=datamodule.num_features,
          num_classes=datamodule.num_classes,
          **kwargs,
      )
  
file_path: lightning-flash/src/flash/tabular/classification/model.py
imports: from functools import partial
  from typing import Any, Callable, Dict, List, Optional, Type, Union
  from torch.nn import functional
  from flash.core.classification import ClassificationAdapterTask
  from flash.core.data.io.input import ServeInput
  from flash.core.data.io.input_transform import InputTransform
  from flash.core.data.io.output import Output
  from flash.core.integrations.pytorch_tabular.backbones import PYTORCH_TABULAR_BACKBONES
  from flash.core.registry import FlashRegistry
  from flash.core.serve import Composition
  from flash.core.utilities.imports import _TOPIC_TABULAR_AVAILABLE, requires
  from flash.core.utilities.types import INPUT_TRANSFORM_TYPE, LR_SCHEDULER_TYPE, METRICS_TYPE, OPTIMIZER_TYPE
  from flash.tabular.input import TabularDeserializer
label_desc: Use image node_id 4 for calling the TabularClassifier obj's underlying member method code with example usage: obj.from_data(cls, datamodule) and returns: cls