Part V. Machine Learning

Part V. Machine Learning#

Machine learning uses patterns in observed data to make predictions or identify groups. This part builds on the regression line from Chapter 12. It introduces scikit-learn and the train/test workflow with models that use several predictors, moves to classifiers and how to evaluate them, and ends with finding groups. It covers model building and evaluation, with attention to what the results can support.

Fig. 2 places these chapters among the three main types of machine learning. Supervised learning learns from examples whose answers are known: regression predicts a number and classification predicts a category. Unsupervised learning finds structure in data without answers, such as groups of similar customers. Reinforcement learning, where a program learns by trial and error from rewards, is beyond this book.

A tree. Machine learning branches into supervised learning (regression, Chapters 12 and 13; classification, Chapters 14 and 15), unsupervised learning (clustering and dimension reduction, Chapter 16; association rules, not covered), and reinforcement learning (not covered).

Fig. 2 Types of machine learning and the chapters that cover them.#

Fig. 3 compares the two workflows this part teaches. In supervised learning, a model learns from data whose answers are known, predicts new cases, and is checked on held-out data whose answers are known but were not used to build it. In unsupervised learning, there are no answers: a clustering method produces groups, and the analyst decides what they mean.

Two columns. Supervised learning, Chapters 12 to 15: labeled data, then a learning method such as nearest neighbors or regression, then a model, which predicts new cases and is checked on held-out data. Unsupervised learning, Chapter 16: unlabeled data, then a clustering method such as k-means, then numbered groups, then the analyst interprets and names the groups, with no test accuracy.

Fig. 3 Supervised and unsupervised learning workflows. Chapters 14 and 16 show each one in detail.#

Conceptual Arc

Begin with Multiple Regression. Continue through Classification and Evaluating Classifiers. Finish with Clustering.

Chapters in This Part

Multiple Regression

Topics: Regression with scikit-learn; Multiple Regression; Choosing Features and Avoiding Overfitting.

Classification

Topics: Classification; Nearest Neighbors; Training, Testing, and Accuracy.

Evaluating Classifiers

Topics: Nearest Neighbors with scikit-learn; Evaluating Classifiers; Logistic Regression.

Clustering

Topics: Clustering Concepts; K-Means Workflow; Interpreting Clusters; Principal Component Analysis (optional).