liveBook · Manning

Chapter 6: The universal workflow of machine learning

What you will learn in chapter 6 of Deep Learning with Python, Third Edition

The introduction contrasts ready-made training examples with real-world machine learning work, which begins with a problem rather than a dataset.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction contrasts ready-made training examples with real-world machine learning work, which begins with a problem rather than a dataset.

Key terms: labeled dataset, problem

6.1 Defining the task

This section establishes that defining a machine-learning task begins with understanding the customer's problem and the context in which a model would be used.

Key terms: context, business problem, machine learning task

6.1.1 Framing the problem

This section explains how to frame a machine-learning project by identifying a feasible prediction task, understanding its real-world context, testing its assumptions, and considering its ethical consequences.

Key terms: inputs, targets, training data, machine learning task, existing solutions, constraints, full context, hypotheses, inputs X, targets Y

6.1.2 Collecting a dataset

This section explains how to collect and label training data that supports generalization, with particular attention to representativeness, change over time, and sampling bias.

Key terms: generalize, data points, labels, features, supervised learning, annotations, targets, crowdsourcing, data annotation software, representative

6.1.3 Understanding your data

Explore a dataset before training to find predictive patterns and detect problems that could undermine a model in production.

Key terms: explore and visualize, feature engineering, histogram, missing values, class, imbalance, target leaking, targets, production

6.1.4 Choosing a measure of success

This section explains why a project needs a success metric aligned with its goals and how the type of problem affects the choice of metric.

Key terms: metric for success, higher-level goals, balanced classification, accuracy, area under curve (AUC), receiver operating characteristic (ROC), class-imbalanced problems, ranking problems

6.2 Developing a model

This section places model development within the broader machine-learning workflow and explains why tutorials can make it seem like the whole job.

Key terms: model development, machine learning workflow, problem definition, dataset collection, model deployment and maintenance

6.2.1 Preparing the data

This section explains how to prepare data for neural networks by vectorizing inputs and targets, normalizing values, and handling missing features.

Key terms: data vectorization, tensors, multi-hot encoding, value normalization, homogeneous, mean, standard deviation, gradient updates, missing values, categorical

6.2.2 Choosing an evaluation protocol

This section explains how to choose a validation protocol that reliably estimates a model’s performance on production data.

Key terms: generalization, validation metrics, validation protocol, success metric, hold-out validation set, K-fold cross-validation, iterated K-fold validation, representativity, redundant samples, training set

6.2.3 Beating a baseline

This section explains how to build an initial model that beats a simple baseline, choose a trainable loss, and interpret failure to beat the baseline.

Key terms: statistical power, simple baseline, feature engineering, architecture priors, training configuration, loss function, metric, mini-batch, differentiable, backpropagation

6.2.4 Scaling up: Developing a model that overfits

This section explains why to deliberately make a statistically useful model overfit, and how to recognize when it does.

Key terms: statistical power, optimization, generalization, undercapacity, overcapacity, training loss

6.2.5 Regularizing and tuning your model

This section explains how to improve generalization after a model can overfit, while keeping validation feedback and the final test evaluation reliable.

Key terms: statistical power, overfit, generalization performance, validation data, test data, architectures, dropout, L1 or L2 regularization, hyperparameters, data curation

6.3 Deploying your model

6.3.1 Explaining your work to stakeholders and setting expectations

This section explains how to set realistic expectations with stakeholders before launching a machine-learning model by showing its failures, translating performance into business consequences, and agreeing on launch tradeoffs.

Key terms: stakeholders, failure modes, expectations, human-level performance, accuracy, false-negative rates, false-positive rates, business goals, key launch parameters, probability threshold

6.3.2 Shipping an inference model

This section explains how to ship a trained model for inference, choose where it runs, and reduce its resource requirements.

Key terms: inference, export(), TensorFlow Serving, ONNX, computation graph, REST API, managed third-party cloud service, on-device, TensorFlow Lite, ONNX runtime

6.3.3 Monitoring your model in the wild

Deploying a model is not the end of the workflow: its production behavior and impact must be monitored using comparisons and ongoing evaluation.

Key terms: monitoring, production data, business metrics, randomized A/B testing, control subset, old process, manual audit, manually annotated, user surveys

6.3.4 Maintaining your model

This section explains why deployed models need replacement and how to prepare for the next version.

Key terms: concept drift, production data, next generation, label set, annotation pipeline

6.4 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 5: Fundamentals of machine learning Chapter 7: A deep dive on Keras →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.