7.3 Practical Exercises: Chapter 7
In this exercise section, we’ll apply feature engineering techniques within TensorFlow/Keras pipelines, focusing on preparing data, handling preprocessing layers, and constructing end-to-end workflows with tf.data. These exercises are designed to reinforce the concepts of embedding preprocessing steps into the model pipeline.
Exercise 1: Normalizing and Encoding Data Using Keras Preprocessing Layers
Objective: Use Keras preprocessing layers to normalize numeric data and one-hot encode categorical data within a model pipeline.
Instructions:
Create a small dataset with two numeric and one categorical feature.
Apply the Normalization layer for the numeric data and the StringLookup with CategoryEncoding layer for the ...