A complete, ready-to-teach university course in statistical learning —
ten slide decks, ten Jupyter notebooks, nine advanced modules, eight mock exams, and the course datasets.
901 core slides (+199 in optional appendices) · 109 exercises with worked solutions · 10 labs with worked solutions, all running locally & on Colab · 3 + 5 mock exams · 23 datasets
📖 Read it online: chrisw09.github.io/Quantitative-Research-Methods
These materials are based on the textbook An Introduction to Statistical Learning, with Applications in Python (James, Witten, Hastie, Tibshirani & Taylor, Springer 2023 — "ISLP"). The course structure, topics, notation and labs follow the book; please cite it if you reuse these materials (see Citation & licence).
Prepared by Prof. Dr. Christoph Weisser.
| Where to go | What you get | |
|---|---|---|
| 🎓 | Learning it — read a deck, then run its lab | The compiled PDFs need no toolchain; every notebook opens in Colab with one click and resolves its own data. |
| 👩🏫 | Teaching it — the teaching guide | An eleven-session plan, per-session runsheets with timings and cut lists, a generated slide index, and one make command that keeps them in sync with the decks. |
| 🛠️ | Adapting it — repository layout | LaTeX sources for every deck and exam, figures regenerated from the datasets by script, and a pinned Python environment. |
| Material | Count | Notes |
|---|---|---|
| Lecture decks | 10 | Eight ISLP chapters + a two-part precourse · 901 slides, plus 199 in per-deck appendices |
| Exercises | 74 short + 35 extended | Each with a full worked solution, tagged [Concept] / [Math] / [Python] / [Integrative] |
| Lab notebooks | 10 | One per deck, both precourse sessions included, each closing with worked Python solutions to that chapter's exercises |
| Mock exams | 3 + 5 | Three full papers plus five 60-minute short exams — each as questions, worked solutions and an in-class review deck, kept out of git |
| Datasets | 23 CSVs | From statlearning.com, resolved automatically via ISLP |
| Teaching guide | 1 kit | Semester plan, runsheets, slide index, before-class checklist, printable handouts |
You don't need to install anything to read the slides — the compiled PDFs live right in the repo. To run a lab, start in Colab; install locally later, once the course is under way.
This is the route to use in the first session and the one to point a cohort at.
Open any notebook from the lab table in your browser; nothing
to install and nothing to debug on a projector. The first cell detects Colab,
installs the few missing packages (ISLP, plus pygam/xgboost/lifelines
where a chapter needs them; torch is preinstalled), and resolves the data
automatically. A Google account is enough — no account on this repository is
needed, and Colab runs every lab in the course, including module A9's deep-
learning lab.
Faster, works offline, keeps your edits, and what you want for any serious piece
of work — but not a first-session activity. The install pulls in around 150
packages and several hundred megabytes, because the book companion package
ISLP hard-requires torch (along with pytorch_lightning and
torchmetrics): on Windows torch alone is over 100 MB, and on Linux the wheel
bundles the CUDA libraries and is several times larger again. Removing torch
from requirements.txt does not help — pip reinstates it as an ISLP
dependency. Set aside time for it outside class.
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
jupyter lab Chapters/chapter_03/chapter_03_lab.ipynbTested with Python 3.9+. Data loads via the ISLP package when installed,
falling back to the bundled ALL CSV FILES - 2nd Edition/ folder, so it also
works offline.
An 11-session semester (11 × 180 min), 6 ECTS, graded by a single 120-minute written exam at the end. The precourse is taught in the session that opens the semester; the eight chapters follow in ISLP book order. The plan is keyed to chapter numbers — that is what the decks, labs, exercises and runsheets all refer to.
| Chapter | Sessions | Topic |
|---|---|---|
| Precourse — 0 + 0b | 1 | Taught in one session, from both precourse decks: descriptive statistics, probability, distributions, inference, simple regression, Python — and reading notation, logs & exponentials, odds & the logit, likelihood and MLE, counting & cost. 165 slides across the two, so the session is a selection and the decks stay the reference |
| 1 | ½ | Introduction; prediction vs. inference |
| 2 | 1½ | What is statistical learning; model accuracy; bias–variance trade-off |
| 3 | 2 | Linear regression: estimation, inference, dummies, interactions, diagnostics |
| 4 | 2 | Classification: logistic regression, the confusion matrix, ROC/AUC (LDA/QDA, naive Bayes and Poisson are in the appendix) |
| 5 | 1 | Resampling: validation set, k-fold CV, LOOCV, bootstrap |
| 6 | 1 | Model selection & regularization: subset selection, ridge, lasso, PCR/PLS |
| 7 | 1 | Beyond linearity: polynomials, splines, smoothing splines, GAMs |
| 8 | 1 | Tree-based methods: trees, bagging, random forests, boosting |
Chapter 1 is short and opens the same session as the first half of Chapter 2.
Chapters 2, 3 and 4 each span two sessions, breaking where a session can end cleanly: Ch 2 after "regression vs. classification" (p. 41), so accuracy, bias–variance and KNN open the second; Ch 3 after multiple regression and the four questions (p. 79); Ch 4 after the logistic-regression section (p. 46), so evaluation and the lab open the second.
Chapters 9 (SVM), 10 (Deep Learning), 11 (Survival), 12 (Unsupervised) and 13 (Multiple Testing) are no longer taught in the sequence. Each keeps its full deck and its lab as a self-study advanced module — A5, A9, A6, A8 and A7. The mock exams were not rewritten: the final papers are weighted toward modules A9 and A7, Short Exam E still carries a multiple-testing problem drawing on module A7, and any unsupervised-learning question draws on module A8.
Ten decks in Chapters/chapter_NN/, each folder self-contained
(chapter_NN.tex, its images/, the compiled PDF — and the chapter's
companion lab, so everything for one week sits in one place).
Slide counts are given
as main flow (+ appendix): every deck ends with an appendix of optional,
advanced material that the main thread never depends on.
Chapter 3: a computed figure with its takeaway, a worked example, an in-deck exercise, and the solution that follows it.
| Ch. | Deck | What it covers | Exercises | Slides | |
|---|---|---|---|---|---|
| 0 | Precourse (a) — Statistics refresher (taught in session 1) | Descriptive statistics, probability and Bayes, distributions, standard errors and CIs, testing and power, simple regression, the Python toolkit | 10 + 4 | 112 (+20) | |
| 0b | Precourse (b) — Toolkit (taught in session 1) | Reading notation, logs and exponentials, odds and the logit, likelihood, computational cost, the Python patterns the labs use | 6 + 2 | 53 (+14) | |
| 1 | Introduction | What statistical learning is, prediction vs. inference, the three motivating data sets, notation and the design matrix | 3 + 1 | 74 (+8) | |
| 2 | Statistical Learning | Estimating f, parametric vs. nonparametric, the flexibility trade-off, training vs. test error, bias–variance (the Bayes classifier and KNN moved to the appendix) | 8 + 4 | 81 (+42) | |
| 3 | Linear Regression | Least squares, standard errors and t/F inference, confidence vs. prediction intervals, dummies and interactions, the four diagnostics | 12 + 6 | 149 (+19) | |
| 4 | Classification | Logistic regression and the odds scale, confounding, confusion matrices, ROC and AUC — LDA, QDA and naive Bayes moved to the appendix | 10 + 6 | 91 (+52) | |
| 5 | Resampling Methods | The validation set and why it wobbles, LOOCV, k-fold CV and the trade-off inside the estimate, CV pitfalls, the bootstrap | 6 + 3 | 85 (+11) | |
| 6 | Model Selection & Regularization | Best subset and stepwise selection, Cₚ/AIC/BIC/adjusted R², ridge, the lasso and its sparsity, PCR, the p > n regime | 6 + 3 | 73 (+14) | |
| 7 | Moving Beyond Linearity | Polynomials and step functions, regression splines and knots, natural splines, smoothing splines, LOESS, GAMs | 6 + 3 | 93 (+9) | |
| 8 | Tree-Based Methods | Recursive binary splitting, pruning, impurity measures, bagging and out-of-bag error, random forests, boosting | 7 + 3 | 90 (+10) | |
| Total | 74 + 35 | 901 (+199) |
How a deck is built
- Front matter — course-at-a-glance, chapter contents, and a "Notation in this chapter" symbol table.
- Teaching flow — motivation → intuition → formal definition → worked example → interpretation, with colour-coded callout boxes: 🟩 takeaway, 🟦 how-to-read-this, 🟧 worked example, 🟥 pitfall, 🟪 short exercise (🟩 teal solution), 🟣 extended exercise, 🩵 "switch to the notebook now".
- Exercises — one short exercise every ~20 minutes and one extended
exercise every ~45 minutes, each tagged [Concept] / [Math] / [Python]
(short) or [Math] / [Python] / [Integrative] (extended). Every prompt is
followed by its full solution; long ones run across a
(1/2)/(2/2)pair. - Closing summary — chapter-in-one-slide, key formulas at a glance, vocabulary, decision rules and common pitfalls.
- Appendix — the optional, advanced material, opened by a slide that says what is in it and why each item is optional.
Throughout: ~110 purpose-built visuals (71 matplotlib plots computed from the real course datasets + 38 native TikZ diagrams), commented Python on every listing, and numeric answers reproduced against the real data.
What each appendix holds
The appendix sits outside the timed plan: the runsheets stop where it begins and the slide index marks it optional. Every exercise there keeps its full solution, so it works as homework.
| Ch. | In its appendix | Pages |
|---|---|---|
| 0 | χ²/t/F and LLN vs. CLT · the ANOVA decomposition · linear algebra (with Exercise 0.8) · calculus and gradient descent (with Extended Exercise 0.3) · the four-shapes gallery | 20 |
| 0b | least squares as maximum likelihood (with Extended Exercise 0b.1) · counting and the 2ᵖ cost (with Exercise 0b.5) · the three scales, drawn | 14 |
| 1 | the design matrix entry by entry · the two dataset lookup tables · the two recreated overview figures | 8 |
| 2 | the third U-curve rendering · Extended Exercise 2.1 (bias–variance from first principles) · Extended Exercise 2.3 (the Bayes boundary for two Gaussians) · the whole classification thread: the Bayes classifier and its error rate, KNN, and Exercises 2.6, 2.7, E2.2 and E2.4 | 42 |
| 3 | squared vs. absolute loss · Extended Exercise 3.L2 (deriving least squares) · the matrix form of multiple regression · Extended Exercise 3.L6 (linear vs. polynomial vs. KNN) · the RSS surface and ISLP Fig 3.1 recreated · linear vs. KNN regression and the curse of dimensionality | 19 |
| 4 | how logistic regression is actually fitted (deviance, IRLS) · the multinomial softmax · Extended Exercise 4.2 (LDA from Bayes' theorem) · Extended Exercise 4.3 (naive Bayes by hand) · GLMs and Poisson regression · ISLP Fig 4.2 recreated on Default | 52 |
| 5 | Exercise 5.2 and Extended Exercise 5.1 — the LOOCV leverage-shortcut drills · ISLP Fig 5.5 (5-fold CV) | 11 |
| 6 | the constraint geometry redrawn · Exercise 6.1 (counting models) · Extended Exercise 6.2 (orthonormal design, soft thresholding) · partial least squares with Exercise 6.6 · Extended Exercise 6.1 (all criteria across sizes) | 14 |
| 7 | the truncated-power basis and the constraint count · Extended Exercise 7.1 (regression splines by hand) · the four-models panel | 9 |
| 8 | the partition picture redrawn · Extended Exercise 8.2 (impurity measures and pruning) · BART · ISLP Figs 8.1 and 8.2 (the Hitters tree) | 10 |
The two precourse decks
Chapter 0 — the statistics refresher. The first of the two decks the opening
session draws on (105 slides plus a 17-slide appendix), revisiting what the
course assumes: descriptive statistics,
probability and Bayes, the standard distributions, sampling and confidence
intervals, hypothesis testing, simple linear regression, and the
numpy/pandas toolkit; the matrix algebra and the calculus/gradient-descent
strands sit in its appendix. It opens with a twelve-question self-check so
students can decide whether they need it, and closes with a table mapping every
topic to the chapter that uses it. Nineteen figures — Anscombe's quartet,
Simpson's paradox, the CLT, CI coverage, power, gradient descent — are computed
from the course data by
make_figures.py; the companion
notebook is chapter_00_lab.ipynb.
Chapter 0b — the toolkit. The second deck of that session, covering what the
later chapters use but never explain, chosen by counting actual usage across the nine
chapter decks: reading notation (Σ, Π, arg max, indicators, sets — 180 uses),
logs and exponentials (176), odds and the logit (108), likelihood and maximum
likelihood (37), counting and the 2ᵖ cost (13), and the Python patterns every
lab relies on (functions, loops, seeds, fit/predict, train/test discipline).
Companion notebook:
chapter_00b_lab.ipynb.
Rebuilding a deck
Requires a TeX Live distribution (with beamer, tcolorbox, tikz,
listings, booktabs):
cd Chapters/chapter_NN
pdflatex chapter_NN.tex
pdflatex chapter_NN.tex # second pass for the navigation barOr run make from the repository root: it rebuilds only what changed and
refreshes the slide index.
Eleven notebooks, each beside the deck it accompanies at
Chapters/chapter_NN/chapter_NN_lab.ipynb — one per deck, both precourse
sessions included, each ending in worked Python solutions to that chapter's
exercises. Each 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.
Several labs also verify the deck's by-hand arithmetic in code — the KNN prediction that flips between K=1 and K=3, the 1 − 1/e bootstrap inclusion probability, the 2^p models best-subset selection would fit, the K+4 degrees of freedom of a cubic spline, Gini separating two splits that classification error cannot, the 931-parameter network. Where a deck asserts a number, the lab computes it.
Every notebook is also rendered in full on the documentation site, stored outputs included.
Teaching_Guide/ holds what you need to walk into a room:
| File | What it is |
|---|---|
semester_plan.md |
The eleven sessions on one page, the three split points, and what to sacrifice when you fall behind |
slide_index.md |
Generated from the PDFs: every section with its page range and time budget, every exercise and solution with its page |
before_class.md |
The ten-minute checklist for the evening before and the morning of |
runsheets/ |
One page per session — timings, what to run live, what to cut, what students get wrong. Git-ignored: they map exercises onto exam problems |
handouts/ |
Printable two-up PDFs of every deck (make handouts) |
Runsheet timings cover the main flow of a deck; appendix pages are material to assign, not to teach.
make # figures, any deck whose source changed, and the slide index
make check # page counts, and any slide that overruns its frame
make handouts # printable 2-up PDFs of every deck
make help # the restThree practice exams matched to the course rhythm, each built from a single LaTeX source so the paper and its solutions can never diverge. All numeric answers were verified programmatically. Each ships in three formats: questions, worked solutions, and a Beamer deck for reviewing the exam in class.
| Exam | After | Covers | Format |
|---|---|---|---|
| Mock Exam 1 | after Ch 3 | Ch 1–3 | 90 min · 90 pts |
| Mock Exam 2 | after Ch 6 | Ch 4–6 (+ light cumulative) | 90 min · 90 pts |
| Final Mock Exam | after Ch 8 | All chapters (weighted to Ch 7/8 and modules A9 and A7) | 120 min · 120 pts |
The final exam also exists in three parallel versions (A / B / C) — same structure and difficulty, different numbers.
Marking a stack of scripts. Every paper is built for fast, consistent correction:
- a marking table on the front page (per-problem maxima and a box for the awarded marks);
- an "Answer key at a glance" page opening every solutions PDF — one row per sub-part with its expected result and its credit, so most scripts can be marked from a single page;
- a grading key box after each problem, splitting the credit sub-part by sub-part and naming what earns partial marks and where error-carried-forward applies;
- the answer-key page and the review deck's "Marking at a glance" frame are
generated from the same file in
keys/, so paper and deck cannot drift apart.
make exam-check verifies all of it without compiling anything: that the
sub-part points add up to each problem header and to the stated total, that the
answer key covers every sub-part with the same credit the paper awards, that no
solution or grading box escapes the \withsolutions guard into the student
paper, and that no two versions of the final share a computed answer.
Alongside them, five 60-minute short exams (A–E, three problems × 20 points)
form the formative layer, released one at a time as the material each needs is
taught — A after Ch 4, B after Ch 5, C after Ch 6, D after Ch 8, and E at the
end of the course, once module A7 (Ch 13) has been assigned as self-study. They are the papers to give a student who has fallen
behind. They live in
Mock_Exams/Short_Mock_Exams_60min/ and build with their own ./build.sh, not
make exams.
🔒 Not distributed here. The exams, their solutions and their LaTeX sources are assessment material and are deliberately kept out of this repository (see
.gitignore). Instructors can request them from the author at info@profweisser-ai.de.
Nine optional, self-study modules: four extend the course beyond ISLP and five are ISLP chapters lifted out of the taught sequence — same house style as the chapter decks (every exercise followed by its worked solution, closing summary, optional appendix), each paired with a companion notebook whose numbers match the slides seed-for-seed:
| Module | Title | Deck | Notebook | Open in Colab |
|---|---|---|---|---|
| A1 | Randomised Controlled Trials — potential outcomes, selection bias, power, peeking | 69 (+6) slides | advanced_01_rcts_lab.ipynb |
|
| A2 | Explainable AI with Shapley Values — axioms, exact and Monte-Carlo Shapley, pitfalls | 71 (+8) slides | advanced_02_shapley_lab.ipynb |
|
| A3 | Conformal Prediction — split conformal, CQR, prediction sets, the OLS stress test | 70 (+7) slides | advanced_03_conformal_lab.ipynb |
|
| A4 | GLMs and Splines — exponential family, overdispersion, penalized splines, a count GAM | 82 (+8) slides | advanced_04_glms_splines_lab.ipynb |
|
| A5 | Support Vector Machines (ISLP Ch 9) — margins, the soft margin and C, kernels, tuning by CV | 84 (+10) slides | advanced_05_svm_lab.ipynb |
|
| A6 | Survival Analysis (ISLP Ch 11) — censoring, Kaplan–Meier, the log-rank test, Cox regression | 86 (+10) slides | advanced_06_survival_lab.ipynb |
|
| A7 | Multiple Testing (ISLP Ch 13) — FWER, Bonferroni and Holm, FDR, Benjamini–Hochberg | 63 (+11) slides | advanced_07_multiple_testing_lab.ipynb |
|
| A8 | Unsupervised Learning (ISLP Ch 12) — PCA, scaling, K-means and its local optima, dendrograms and linkage | 91 (+10) slides | advanced_08_unsupervised_lab.ipynb |
|
| A9 | Deep Learning (ISLP Ch 10) — single-layer networks, MLPs and parameter counts, convolutions, loss and SGD, regularisation | 72 (+19) slides | advanced_09_deep_learning_lab.ipynb |
Nothing in the taught plan depends on them — but the mock exams still carry a
multiple-testing problem, which now draws on module A7, and any
unsupervised-learning question now draws on module A8. See the
module guide for prerequisites and build instructions;
make advanced rebuilds the decks.
Six 3–5 hour challenges in Projects/ where students take a
real decision on real data. Unlike the labs, there is no worked solution: each
brief poses a problem someone actually has, fixes a seeded held-out test set,
gives a baseline to beat, and asks for a one-page memo with specific numbers.
Each has a trap the brief does not reveal, and in several of them "this cannot
be predicted well enough to act on" is a correct answer. The projects are
formative — the module is graded by the written exam — and each folder carries a
SOLUTION_NOTES.md with expected findings and a marking guide.
| Path | Contents |
|---|---|
Chapters/ |
One folder per chapter, holding its deck and its lab together: chapter_NN/ contains chapter_NN.tex, the compiled .pdf, images/, and chapter_NN_lab.ipynb. Ten decks and ten notebooks, one pair per chapter. See its deck guide. |
Chapters/Advanced/ |
Nine optional self-study modules — RCTs, Shapley values, conformal prediction, GLMs & splines, SVMs, survival analysis, multiple testing, unsupervised learning — each a full deck plus companion notebook. See its module guide. |
Projects/ |
Six short projects (3–5 h): a real decision on real data, with a fixed held-out set, a baseline to beat and a one-page memo as the deliverable. See its project guide. |
Teaching_Guide/ |
Instructor material: semester plan, runsheets, slide index, before-class checklist, printable handouts |
ALL CSV FILES - 2nd Edition/ |
Course datasets (from statlearning.com) |
Makefile |
One-command rebuild of figures, decks, handouts and the index |
docs/ |
Sphinx documentation for the whole course — see Documentation |
requirements.txt |
Pinned Python environment for the notebooks |
Mock_Exams/ |
Three exams plus three parallel variants of the final, and five 60-min exams (questions, solutions, review decks) — excluded from git: assessment material. make exams builds the first group; Short_Mock_Exams_60min/build.sh the second |
Source_Material/ |
Copyrighted textbook PDF & figure banks — excluded from git (see .gitignore) |
requirements.txt pins the packages used by the notebooks
and the in-slide code examples:
| Purpose | Packages |
|---|---|
| Core scientific stack | numpy · pandas · matplotlib · seaborn · scipy |
| Statistics & ML | statsmodels · scikit-learn |
| Book companion (datasets + helpers) | ISLP |
| Chapter-specific | pygam (Ch 7) · xgboost (Ch 8, optional) · torch (module A9) · lifelines (module A6) |
| Notebook environment | jupyter |
The datasets live in
ALL CSV FILES - 2nd Edition/ and are
distributed by the textbook authors at
statlearning.com for use with the book. In the
notebooks, datasets load straight from the ISLP package wherever possible;
the four the package does not ship (Advertising, Heart, Income1,
Income2) stream from the book's official site, and the bundled CSVs act as an
offline fallback. The decks attribute every book
figure to its source.
📖 https://chrisw09.github.io/Quantitative-Research-Methods/
Everything above — the course plan, the decks, all ten labs rendered in full, the teaching guide, the exams and the datasets — is published as a browsable site. It is built and published by hand — the repository carries no CI — so after changing the materials, rebuild and deploy it (see Building the docs).
To build it locally from docs/:
pip install -r docs/requirements.txt
sphinx-build -b html docs docs/_build/html
open docs/_build/html/index.html # Linux: xdg-openThe build stages the notebooks and the deck PDFs into the site automatically, so
the generated docs/_build/html/ folder is self-contained. Details, including
how the deployment works, are in
docs/building-docs.md.
I am Christoph Weisser, Professor of Mathematics, specializing in Business Data Science at Hochschule Bielefeld, and former Technical Lead Analytics & Artificial Intelligence at BASF. My work focuses on Artificial Intelligence, Generative AI, Business Data Science, and agentic AI systems that bridge research with real-world industrial applications.
Before joining academia, I led international AI initiatives at BASF from strategy through production deployment. Today, I combine research, teaching, open-source software development, and selected industry collaborations to advance the practical application of AI.
I hold two master’s degrees from the University of Oxford and the University of St Andrews and completed the PhD Program in Applied Statistics & Empirical Methods (summa cum laude) at Georg-August-Universität Göttingen. I was awarded scholarships by the Studienstiftung des deutschen Volkes, the Konrad-Adenauer-Stiftung, and the Evangelisches Studienwerk Villigst. I regularly publish research in leading journals and at international conferences and contribute to open-source software.
The Quantitative Research Methods course materials are based on, and follow the structure of, the textbook An Introduction to Statistical Learning, with Applications in Python. If you reuse them, please cite the source textbook:
James, G., Witten, D., Hastie, T., Tibshirani, R., & Taylor, J. (2023). An Introduction to Statistical Learning, with Applications in Python. Springer Texts in Statistics. Springer. https://www.statlearning.com
BibTeX:
@book{islp2023,
title = {An Introduction to Statistical Learning: with Applications in Python},
author = {James, Gareth and Witten, Daniela and Hastie, Trevor and Tibshirani, Robert and Taylor, Jonathan},
year = {2023},
publisher = {Springer},
series = {Springer Texts in Statistics},
isbn = {978-3-031-38746-3},
doi = {10.1007/978-3-031-38747-0},
url = {https://www.statlearning.com}
}Attribution. The slides, exercises, mock exams and notebooks in this
repository were prepared by Prof. Dr. Christoph Weisser. The ISLP textbook, its text and its figures are © the authors / Springer;
the datasets are distributed by the authors at
statlearning.com for use with the book. The
copyrighted textbook PDF and figure banks are not included in this
repository (see .gitignore).
Happy teaching 🎓