Machine Learning for Economists

This is an MPhil course. Every idea arrives three times: as a lecture, as an R lab, and as a Python lab. The examples are drawn from economics and from Pakistani data, because a method you have never applied to a question you care about is a method you do not yet own.

Start with Chapter 1 Read the syllabus

School of Economics, Quaid-i-Azam University, Islamabad · Prof. Dr. Zahid Asghar

The course in one paragraph

Most econometrics training teaches you to estimate a parameter and defend it. Machine learning asks a different question: how well will this model do on data it has never seen? That single shift, from explanation to prediction, changes how we choose models, how we spend our data, and what we mean by a good fit. Over the semester we work through the bias–variance trade-off, linear and logistic regression seen through a predictive lens, resampling, regularisation, trees and ensembles, unsupervised learning, and finish with deep learning and where causal inference and prediction meet. Along the way you will build the habit of writing reproducible code, in whichever of the two languages you prefer.

Chapters

How the material is organised

Every chapter page follows the same shape, so you always know where to look.

Section What sits there
Slides The lecture deck, as PowerPoint or Quarto RevealJS
Labs A tabset with the R lab on one tab and the Python lab on the other
Readings Chapter handouts and supporting papers
Exercises ISLR applied problems and the solutions we work through in class

If you would rather browse by material type than by topic, the Labs, Slides, Readings, Data and Assessment pages list everything in one place.

Two languages, one course

You are not asked to learn both. Pick the language you will actually use and follow that track; the tabs exist so that the choice never costs you access to the material. R labs lean on tidyverse, tidymodels and glmnet; Python labs lean on pandas, scikit-learn and matplotlib. The statistics are identical either way.

Prerequisites

A first course in econometrics or mathematical statistics, comfort with matrix notation, and a willingness to write code that breaks before it works. No prior machine learning is assumed.

Back to top