liveBook · Manning

High-level API

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

A high-level deep learning API abstracts common neural-network construction and training tasks.

A high-level deep learning API abstracts parts of model construction, data pipelines, and training while leaving a lower-level framework underneath. Keras sits above TensorFlow, and fastai sits above PyTorch; both support more than tabular data. section 8.1 section 8.2.2

Choose the abstraction level according to the problem and the trade-offs you can accept:

  • Keras keeps model details transparent but requires custom pipeline and layer code for tabular data. section 8.2.2
  • fastai provides explicit tabular support, compact code, an automatically defined pipeline, and dataset-inspection conveniences. section 8.2.2
  • Higher abstraction can speed development, but framework assumptions may create debugging problems; community size also affects production support. section 8.2.2

Airbnb NYC price classification

A tabular model can accept separate categorical, continuous, and text inputs and produce one prediction: whether an Airbnb listing price exceeds the median. A custom Keras model defines layers for each input type; the reported Keras accuracy is 70–74%, compared with about 81% for fastai. section 8.1 section 8.2.2

Table 8.1 Summary of the pros and cons of the Keras and fastai solutions (view table figure)

Keras

fastai

Pro

Model details are transparent.

Large community using the framework means that it’s easy to find solutions to common problems

Framework includes explicit support for tabular data models, which means the code is much more compact.

Framework automatically defines pipeline.

Framework includes convenience functions that make it easy to examine the dataset.

Con

No built-in support for tabular data, which means we need to define custom code to define the pipeline and layers for the model.

Assumptions made by the framework can lead to tricky problems that are hard to debug.

User community is smaller and less involved in deploying production applications than the Keras community, which means it can be harder to find solutions to problems.

Compare Keras and fastai by transparency, tabular support, pipeline automation, debugging, and production-community support. section 8.2.2

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Defines the abstraction and compares trade-offs, but defers detailed layer construction and framework internals.
Examples
Uses an Airbnb NYC tabular classifier with categorical, continuous, and text inputs to compare Keras and fastai.
What it assumes
Distinguishes low-level frameworks from higher-level APIs while introducing the main framework and library choices.
What you can do after
Apply it via Keras or fastai to select an abstraction suited to tabular modeling and framework support needs.
How it connects
Connects TensorFlow, PyTorch, Keras, fastai, TabNet, PyTorch Lightning, and tabular data libraries.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.