Machine Learning

3. Machine Learning#

Machine learning turns historical data into predictions that support business decisions: which customers will leave, which transactions look fraudulent, how much inventory to order. This chapter treats prediction as a management tool and focuses on how to judge a model by the cost of its mistakes.

  • Prediction: A model estimates an unknown outcome from known inputs so that managers can act before the outcome occurs.

  • Model Evaluation: Accuracy alone can mislead; precision, recall, and holdout testing show how a model really performs.

  • Error Costs: False positives and false negatives carry different business costs, and the right threshold depends on them.

Chapter Video

This introduction shows how machine learning turns data into predictions and why models must be tested on new data.

A Gentle Introduction to Machine Learning (12:45) by StatQuest with Josh Starmer

Hosted on YouTube; property of its original creator, embedded here for educational reference only.

Learning Objectives

By the end of this chapter, you will be able to:

  1. Frame a prediction task using features, outcomes, and proposed actions.

  2. Distinguish classification, regression, and causal intervention claims.

  3. Calculate confusion-matrix counts, precision, and recall.

  4. Compare thresholds using error costs and review capacity.

  5. Fit a simple prediction rule and compare training and holdout performance with Python.

  6. Distinguish repayment prediction, intervention effects, and error consequences across service and financial decisions.

Chapter Flow

Concept Map

Glossary

#

Term

Explanation

1

Feature

An input used to predict an outcome.

2

Target

The outcome a model is trained to predict.

3

Classification

Prediction of a category.

4

Regression

Prediction of a numerical value.

5

Training set

Records used to fit a model.

6

Holdout set

Records withheld from fitting to assess performance.

7

Confusion matrix

Counts of actual and predicted classes.

8

Precision

True positives divided by all predicted positives, when defined.

9

Recall

True positives divided by all actual positives, when defined.

10

False positive

A positive prediction for a negative case.

11

False negative

A negative prediction for a positive case.

12

Decision threshold

A score cutoff used to select an action.

13

Causal effect

A change attributable to an intervention rather than prediction alone.

14

Expected loss

A probability-weighted loss under stated event and loss assumptions; not an individual certainty or an approval rule.

15

Validation set

Records used to compare designs and choose settings such as a threshold.

16

Test set

Records reserved to evaluate the final selected design once.

17

Overfitting

Learning patterns that fit training examples but do not generalize to new cases.

18

Precision at k

The share of the k highest-scoring cases that are true positives; useful when reviewers can handle only k cases.

19

Leakage

Using information that would not be available when the real decision is made.

20

Calibration

How closely predicted probabilities match observed outcome frequencies.

21

Prevalence

The share of cases with the outcome being predicted.