Lab notebooks¶
Fifteen notebooks, one per chapter, each living beside the deck it accompanies
in Chapters/chapter_NN/chapter_NN_lab.ipynb. They come in two kinds.
Twelve taught labs — one per lecture deck, both precourse sessions included. Each mirrors its chapter’s Python lab and closes with worked solutions to that chapter’s exercises. These are the labs the course is built around.
Three code references — chapters 9, 11 and 12 have a notebook but no lecture deck and no worked solutions. They show how to run the methods in Python; the ISLP chapter does the teaching. Read the chapter first.
Each notebook runs locally or on Google Colab; data loads via the ISLP
package with an automatic fallback to the bundled CSVs, so nothing needs
downloading by hand. Colab is the recommended route — nothing
to install.
Every notebook is rendered in full below (with its stored outputs — the documentation build never executes them).
12 taught labs (with solutions) 3 code references (no deck, no solutions) runs locally and on Colab
Lecture chapters — the twelve taught labs¶
Ch. |
Lab |
Read here |
Open in Colab |
|---|---|---|---|
0 · Precourse (a) — Statistics |
|
||
0b · Precourse (b) — Toolkit |
|
||
1 · Introduction |
|
||
2 · Statistical Learning |
|
||
3 · Linear Regression |
|
||
4 · Classification |
|
||
5 · Resampling Methods |
|
||
6 · Model Selection & Regularization |
|
||
7 · Moving Beyond Linearity |
|
||
8 · Tree-Based Methods |
|
||
10 · Deep Learning |
|
||
13 · Multiple Testing |
|
Untaught chapters — three code references¶
These three ISLP chapters are outside the twelve-lecture plan. There is no deck for them, and the notebooks ship without worked solutions: the exercises at the end are left unanswered on purpose. Treat each as a code reference to read alongside its ISLP chapter, not as a lab equivalent to the twelve above.
Ch. |
Code reference |
Read here |
Open in Colab |
|---|---|---|---|
9 · Support Vector Machines |
|
||
11 · Survival Analysis |
|
||
12 · Unsupervised Learning |
|
Tip
The Colab badges open straight from the public GitHub repository; a Google account is all you need to run a notebook.
How the notebooks find their data¶
Each notebook opens with a setup cell that:
detects whether it is running on Colab and installs any missing packages (
ISLP, pluspygam/xgboost/lifelinesfor the chapters that need them —torchis preinstalled on Colab);loads each dataset from the
ISLPpackage where possible, streams the four it does not ship (Advertising,Heart,Income1,Income2) from the book’s official site, and falls back to the bundledALL CSV FILES - 2nd Edition/folder otherwise.
So a fresh Colab runtime works with no manual downloads, and a local checkout works offline.
All notebooks¶
- Chapter 0 — Precourse Refresher
- Chapter 0b — Precourse Toolkit
- Chapter 1 — Introduction
- Chapter 2 — Statistical Learning
- Chapter 3 — Linear Regression
- Chapter 4 — Classification
- Chapter 5 — Resampling Methods
- Chapter 6 — Model Selection and Regularisation
- Chapter 7 — Moving Beyond Linearity
- Chapter 8 — Tree-Based Methods
- Chapter 9 — Support Vector Machines
- Chapter 10 — Deep Learning
- Chapter 11 — Survival Analysis
- Chapter 12 — Unsupervised Learning
- Chapter 13 — Multiple Testing
Where to go next¶
Lecture slides — the deck each taught lab accompanies.
For students — how the labs relate to the lectures, and what to do when your numbers differ.
Datasets — what is bundled, and which chapter uses it.
Python environment — the pinned packages, and the four chapter-specific ones.