liveBook · Manning

StringLookup

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

StringLookup is a Keras preprocessing layer that maps string tokens to integer indices.

StringLookup is a Keras preprocessing layer that learns a vocabulary from string-valued categorical data and maps tokens to integer indices before encoding. section 9.3.2

A practical categorical-feature pipeline follows these steps:

  • Select a string column from the input dataset, such as Location or Furnishing. section 9.3.2

Real-estate model input

A Kuala Lumpur property model gives each categorical column an input layer, StringLookup layer, and CategoryEncoding layer, while continuous columns use normalization layers. This suits columns with roughly 100 or fewer unique values; larger vocabularies may make one-hot encoding memory-intensive. section 9.3.2

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

How deep it goes
Defines, adapts, and applies the lookup, then stops at integer indices before CategoryEncoding.
Examples
Uses Location, Property Type, Furnishing, and Size_type_bin from a Kuala Lumpur real-estate dataset.
What it assumes
Uses a prepared TensorFlow dataset containing string-valued categorical features.
What you can do after
Builds a categorical preprocessing pipeline by adapting StringLookup and composing it with CategoryEncoding.
How it connects
Connects categorical inputs with CategoryEncoding, IntegerLookup, normalization layers, and model concatenation.

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.