Resources
The course materials are complete on their own: the lectures, the exercises, the case and the cheatsheet are all you need. Everything here is either the official reference you should learn to use, or something extra for when you want to go further.
needed use it during the course · extra only if you want more
Official documentation needed
Learn to read these rather than searching for a blog post. They are written by the people who wrote the code, they match the version you have, and the reference part of them is already on your machine: hovering a name in VS Code shows the same text.
- docs.python.org the language and its standard library. The tutorial is a good second pass over Sessions 1 and 2.
- numpy.org/doc arrays and linear algebra. Start with NumPy for absolute beginners.
- pandas.pydata.org/docs tables. Start with 10 minutes to pandas, which covers most of Session 3 in one page. The user guide explains the ideas; the API reference is what you look details up in.
- The matplotlib gallery a wall of example charts, each with the code that made it. Find the picture closest to what you want and read how it was done. This is how everybody learns plotting, including people who do it for a living.
- The scikit-learn user guide every model from Session 5 on, each with a page that explains the idea, shows the maths and links to worked examples. The pages the course leans on:
| Session | Page of the scikit-learn user guide |
|---|---|
| 5 | Cross-validation, including TimeSeriesSplit |
| 6 | Linear models (ridge, lasso, elastic net), pipelines and grid search |
| 8 and 9 | Logistic regression, nearest neighbours and the scores of a model |
| 11 | Decision trees and ensembles (bagging, random forests) |
| 12 | Gradient boosting, permutation importance, and the XGBoost and LightGBM documentation |
Taking the documentation offline needed
Two things are worth knowing, because there are times you will not have a search box.
The reference is already on your machine. Every package carries its
own manual inside it. Hover a name in VS Code, or call help(name) in a
cell, and you get the signature and the parameter list. That is the same text the
reference pages on the website are generated from.
The full sites can be downloaded. Python publishes its whole documentation as a single archive at docs.python.org/3/download.html, and the NumPy and pandas sites offer offline copies of their versioned documentation too. Worth doing once, in good time, rather than on a day you need it.
help() and hover, and much easier to
learn now than under time pressure.
Books, free and legal needed
- An Introduction to Statistical Learning, with Applications in Python (James, Witten, Hastie, Tibshirani, Taylor). Free PDF from the authors, and the conceptual reference for the machine-learning half of the course. The same site carries the book's Python labs, the worked code behind each chapter and a good second look at anything a lecture went past quickly. If you read one thing beyond the slides, read the section for the session:
| Session | In the book |
|---|---|
| 4 | Sections 2.1 and 2.2: the statistical learning framework, the reducible and irreducible error, assessing accuracy, the bias-variance trade-off. Session 4 follows them in the same order. |
| 5 | Chapter 3 for linear regression, and section 5.1, cross-validation |
| 6 | Section 6.2: shrinkage methods, ridge and the lasso, and how to choose their strength |
| 8 and 9 | Sections 4.1 to 4.3: classification and logistic regression; section 2.2.3 for the classification setting and k-nearest neighbours |
| 11 | Section 8.1, decision trees, and sections 8.2.1 and 8.2.2: bagging and random forests (section 5.2 explains the bootstrap) |
| 12 | Section 8.2.3: boosting |
- Python for Data Analysis (Wes McKinney, who wrote pandas). Free to read online. The chapters on NumPy and pandas are the natural next step after Session 3. extra
- The Elements of Statistical Learning (Hastie, Tibshirani, Friedman). The same ideas as the book above, with the maths written out in full; free PDF from the authors. Only if you want the derivations. extra
When something has not clicked needed
Almost every beginner gets stuck in the same two places: what a variable actually holds after a line runs, and what a loop is doing on each pass. Reading the code again rarely fixes either. Watching it run does.
- Python Tutor paste in a short piece of code and step through it one line at a time. It draws every variable as it changes, and the arrows from names to values are the picture the Session 1 slides use. Free, in the browser, nothing to install. Twenty lines is about the limit, which is exactly the size of the exercises.
printis the other debugger. When a loop gives the wrong answer, put aprintinside it and run it once. Seeing the wrong value appear on the pass where it first goes wrong is usually the whole diagnosis.- For a model that has not clicked, read the book's section for the session (the table above), then the scikit-learn page for the method. Change one setting in the lecture's code cell and run it again: the slide shows what moved.
- StatQuest short videos by Josh Starmer that explain cross-validation, ridge and the lasso, logistic regression, trees, random forests and gradient boosting step by step, with pictures. A good second explanation. extra
Revising away from a screen extra
Every lecture and both of the course's reference pages come as PDFs, which is worth knowing before an offline exam. All of them are on the Exam info page.
- The lectures: every slide, with the result of every code cell. Printing a lecture from the browser leaves those results out, because a code cell only runs once its slide is on screen; the PDFs were made after every cell ran.
- The cheatsheet: allowed at the exam as a copy saved on your laptop.
- The maths brush-up, for reading formulas.
More practice extra
Only if you have finished the exercises and want more. None of this is examined.
- Kaggle Learn short free micro-courses, each a few hours, that run in your browser with nothing to install. Python, Pandas, Data Visualization, Intro to Machine Learning and Intermediate Machine Learning (pipelines, cross-validation and XGBoost) overlap this course closely and are a good second explanation if something has not clicked.
- Kaggle datasets thousands of real datasets to practise on. Pick something you are actually curious about: you will learn more from a question you care about than from another tutorial.
- Exercism, Python track small programming puzzles with feedback from volunteer mentors. Good for making the language itself feel automatic.
Machine learning in finance, further extra
Where the methods of this course meet research in finance. Both are long, and both are free working-paper versions.
- Empirical Asset Pricing via Machine Learning (Gu, Kelly and Xiu, published in the Review of Financial Studies, 2020). Penalised regression, forests, boosted trees and neural networks set against each other on forecasting stock returns: the course's model comparison, at research scale.
- Financial Machine Learning (Kelly and Xiu, 2023). A survey of what machine learning has been used for in finance and what it has found, written for economists.
The data this course uses extra
Every file was downloaded once and is part of the course, so the materials never depend on a live connection and everyone works with exactly the same numbers: any number you compute at home should match a number from class. The files are on the downloads page.
| File | What it is | Sessions | Source |
|---|---|---|---|
prices.csv | Daily closing prices of AAPL, MSFT, NVDA, JPM, KO, PG, XOM, JNJ, WMT, DIS and the S&P 500 ETF SPY, 2015 to 2024, split- and dividend-adjusted; Sessions 1 and 2 use small 2024 extracts of it | 1 to 6, 8, 9, 11, 12 | Yahoo Finance, through the yfinance package. Yahoo's terms are for personal use, so these files are here for teaching only. |
market_features.csv | The nineteen-column table for the index: past volatilities and returns, and next month's volatility as the target | 6, 8, 9, 11, 12 | Built by the course from prices.csv |
aarhus_houses.csv | 7,621 ordinary sales of villas and townhouses in the Aarhus postcodes, January 2021 to September 2024; no addresses, locations to about 100 metres | 7, 13 | "Danish Residential Housing Prices 1992-2024", compiled by Martin Frederiksen from boliga.dk (public land-registry records) for educational use; located with the Danish address register (DAWA) |
credit.csv | 30,000 credit card holders at a Taiwanese bank in 2005, seven columns, and whether each defaulted the month after | 9, 11, 12 | Yeh, I-C. (2009), Default of Credit Card Clients, UCI Machine Learning Repository, CC BY 4.0 |
power.csv | 26,133 hours of day-ahead prices for West Denmark (DK1), 2022 to 2024, with the day-ahead wind and sun forecasts | 10, 13 | Source: Energinet (www.energidataservice.dk), CC BY 4.0 |
Using AI on this course needed
You may use it, and you should learn to. The distinction that matters is between using it to understand and using it to avoid understanding.
- Good: "explain what this error means", "why does pandas want
.copy()here", "give me a hint, not the answer", "what is this function's second argument called". - Bad: pasting an exercise and copying what comes back. It reads as though you learned something, right up until the exam, where there is no internet and no assistant.
A fair test: could you now write it again, from a blank cell, without help? If not, you have not finished the exercise.
Reusing these materials
The lectures, notebooks, exercises, case, cheatsheet and pages of this course are © 2026 Jonas Theill Bøjstrup, and free to reuse under CC BY 4.0: you may copy them, adapt them and teach from them, as long as you credit the course and link to it, for example:
Two things are not covered. The data files keep their sources' terms, listed in the table above: the prices from Yahoo, and the tables built from them, are for teaching only. And the software the pages run on, from reveal.js to Pyodide, keeps its own licence. The full text of the licence is on the Creative Commons site, and questions about reuse go to jobo@econ.au.dk.