Lightning Flash is a high-level deep learning framework built on PyTorch Lightning for rapid prototyping, baselining, fine-tuning, and solving deep learning problems. For tabular work, it abstracts parts of the underlying PyTorch stack while retaining a clear training-oriented API. section 8.1 section 8.7
A practical fit is a tabular classification workflow where categorical fields, numerical fields, and a target are identified up front. Rather than hand-coding a model pipeline, create a data module from separate training, validation, and prediction CSV files, then derive a classifier from that data definition. section 8.4.1 section 8.4.2
The basic workflow is short:
- Specify the target plus categorical and continuous feature columns. section 8.4.1
- Build a TabularClassificationData object from train, validation, and prediction CSV files. section 8.4.1
- Create a TabularClassifier from the data module and train it with flash.Trainer. section 8.4.1
Training an Airbnb NYC classifier
For an Airbnb NYC listing workflow, categorical inputs include neighbourhood group, neighbourhood, and room type; numerical inputs include minimum nights and review-related fields. A TabularClassificationData object supplies those fields and separate CSV splits, while TabularClassifier.from_data and flash.Trainer run a three-epoch GPU-aware training job. section 8.4.1
Lightning Flash favors fast, simple rollouts: the model and training statements are concise, and categorical and continuous columns are identified without explicitly defining a pipeline. Its trade-off is operational fragility in Colab, where a specific installation order and library versions are needed to avoid conflicts. In an untuned comparison, it had the fastest notebook runtime at 14 seconds, while test accuracy was not reported. section 8.4.2 section 8.5
Listing 8.17 Defining a TabularClassificationData
datamodule = TabularClassificationData.from_csv(
categorical_fields=cat, #1
numerical_fields=cont, #2
target_fields="target", #3
train_file='../data/train.csv', #4
val_file='../data/valid.csv', #5
predict_file='../data/test.csv', #6
batch_size=64
)
Inspect the data-module definition to see how feature types, target, CSV splits, and batch size form the contract between tabular data and training. section 8.4.1
