liveBook · Manning

Keras

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

Keras is an open-source deep learning API for Python that provides interfaces for building and training neural-network models.

Keras is a high-level deep learning API used to implement neural-network solutions for tabular-data problems. In the illustrated stack, it sits above the low-level TensorFlow framework, giving a Python workflow for defining models, training them, and saving the best result. section 3.1.3 section 8.7

Figure 3.4 The stack for the Airbnb NYC Keras solution

The stack view places Keras between an application-level deep learning solution and its TensorFlow foundation. section 3.1.3

For an Airbnb NYC price-prediction model, Keras accepts training features as a list of NumPy arrays. Its model-definition function explicitly builds layers for continuous, categorical, and text columns, making the model’s design visible but requiring more custom code than an XGBoost classifier. section 3.1.5 section 8.1

A practical Keras training workflow includes:

  • Define inputs and layers for each column type, including categorical inputs, embeddings, and batch normalization. section 8.1
  • Train with model.fit using epochs, batch size, validation data, and optionally callbacks. section 3.1.5
  • Use EarlyStopping when progress no longer improves and ModelCheckpoint to retain the best-performing model. section 3.1.5
  • Save and load the trained model; this part has roughly comparable complexity to the paired XGBoost workflow. section 3.1.6

Airbnb NYC price prediction

A Keras baseline trained on the Airbnb NYC tabular dataset reached roughly 80–81% test accuracy in an untuned Colab run, taking about 10–15 seconds without a GPU. The comparison is useful as a baseline, not a universal ranking: XGBoost trained faster in this case, while later tuning can improve deep-learning results. section 3.3.1 section 8.5

Keras favors explicit control: pipeline details and model layers are written out rather than inferred. That transparency can help inspect model behavior and find community-supported solutions, but Keras has no built-in tabular-data support, so pipelines and layers must be custom-defined. For most tabular datasets, gradient boosting is the simpler out-of-the-box choice; Keras remains a valid deep-learning option when its control and TensorFlow ecosystem fit the requirements. section 8.2.2 section 8.5

Keras also supports a best-practice workflow for messier tabular data: prepare data, design the model, train it, and exercise it on a real-estate classification problem. Repeated runs with randomized training, validation, and test subsets provide cross-validation benefits under the described default behavior. section 9.0 section 9.4.1

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

How deep it goes
Explains model layers, fit arguments, callbacks, persistence, evaluation, and repeated-run validation without detailing TensorFlow internals.
Examples
Uses Airbnb NYC listing-price prediction and Kuala Lumpur real-estate price classification.
What it assumes
Introduces training practices for newcomers while serving as a review for experienced model builders.
What you can do after
Apply it via Keras to define, train, checkpoint, load, and evaluate tabular deep-learning models.
How it connects
Connects Keras with TensorFlow, XGBoost, fastai, PyTorch, embeddings, batch normalization, callbacks, and cross-validation.

Also explained in

Compare how 6 books explain Keras →

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.