# EC 524/424, Winter 2026 Welcome to Economics 524 (424): Prediction and machine-learning in econometrics, taught by [Ed Rubin](https://edrub.in) and [Jose Rojas Fallas](https://jose-rojas-fallas.quarto.pub/). ## Schedule **Lecture** Tuesdays and Thursdays, 10:00a-11:20a (Pacific), [105 Esslinger](https://classrooms.uoregon.edu/esslinger-105/) **Lab** Friday, 10:00a–10:50a (Pacific), [072 PLC](https://classrooms.uoregon.edu/plc-72/) **Office hours** - **Ed Rubin** Tu. 3:30p–4:30p ([PLC 530](https://map.uoregon.edu/b83e556a1)) - **Jose Rojas Fallas** We. 2p–3p ([PLC 525](https://map.uoregon.edu/6794b993e)) ## Syllabus [**Syllabus**](https://raw.githack.com/edrubin/EC524W26/master/syllabus/syllabus.pdf) ## Books ### Required books - [Introduction to Statistical Learning](https://www.statlearning.com/) - [The Hundred-Page Machine Learning Book](http://themlbook.com/) - [Data Visualization](https://socviz.co/) ### Suggested books - [R for Data Science](https://r4ds.had.co.nz/) - [Introduction to Data Science](https://www.springer.com/us/book/9783319500164) (not available without purchase) - [The Elements of Statistical Learning](http://web.stanford.edu/~hastie/ElemStatLearn/) - [Data Science for Public Policy](https://link.springer.com/book/10.1007/978-3-030-71352-2) (ebook available through UO library) ## Lecture notes **Note:** Links to topics that we have not yet covered lead to older slides. I will update links to the new slides as we work our way through the term/slides. [**000 - Overview (Why predict?)**](https://raw.githack.com/edrubin/EC524W26/master/lecture/000/slides.html) 1. Why do we have a class on prediction? 2. How is prediction (and how are its tools) different from causal inference? 3. Motivating examples **Formats** [.html](https://raw.githack.com/edrubin/EC524W26/master/lecture/000/slides.html) | [.pdf](https://github.com/edrubin/EC524W26/blob/master/lecture/000/slides.pdf) | [.rmd](https://github.com/edrubin/EC524W26/blob/master/lecture/000/slides.rmd) **Readings** Introduction in *ISL* [**001 - Statistical learning foundations**](https://raw.githack.com/edrubin/EC524W26/master/lecture/001/slides.html) 1. Why do we have a class on prediction? 2. How is prediction (and how are its tools) different from causal inference? 3. Motivating examples **Formats** [.html](https://raw.githack.com/edrubin/EC524W26/master/lecture/001/slides.html) | [.pdf](https://github.com/edrubin/EC524W26/blob/master/lecture/001/slides.pdf) | [.rmd](https://github.com/edrubin/EC524W26/blob/master/lecture/001/slides.rmd) **Readings** - [Prediction Policy Problems](https://www.aeaweb.org/articles?id=10.1257/aer.p20151023) by Kleinberg *et al.* (2015) - *ISL* Ch1 - *ISL* Start Ch2 **Supplements** [Unsupervised character recognization](https://colah.github.io/posts/2014-10-Visualizing-MNIST/) [**002 - Model accuracy**](https://raw.githack.com/edrubin/EC524W26/master/lecture/002/slides.html) 1. Model accuracy 1. Loss for regression and classification 1. The variance-bias tradeoff 1. The Bayes classifier 1. KNN **Formats** [.html](https://raw.githack.com/edrubin/EC524W26/master/lecture/002/slides.html) | [.pdf](https://github.com/edrubin/EC524W26/blob/master/lecture/002/slides.pdf) | [.rmd](https://github.com/edrubin/EC524W26/blob/master/lecture/002/slides.rmd) **Readings** - *ISL* Ch2–Ch3 - *Optional:* *100ML* Preface and Ch1–Ch4 [**003 - Resampling methods**](https://raw.githack.com/edrubin/EC524W26/master/lecture/003/slides.html) 1. Review 1. The validation-set approach 1. Leave-out-out cross validation 1. k-fold cross validation 1. The bootstrap **Formats** [.html](https://raw.githack.com/edrubin/EC524W26/master/lecture/003/slides.html) | [.pdf](https://github.com/edrubin/EC524W26/blob/master/lecture/003/slides.pdf) | [.rmd](https://github.com/edrubin/EC524W26/blob/master/lecture/003/slides.rmd) **Readings** - *ISL* Ch5 - *Optional:* *100ML* Ch5 [**004 - Linear regression strikes back**](https://raw.githack.com/edrubin/EC524W26/master/lecture/004/slides.html) 1. Returning to linear regression 1. Model performance and overfit 1. Model selection—best subset and stepwise 1. Selection criteria **Formats** [.html](https://raw.githack.com/edrubin/EC524W26/master/lecture/004/slides.html) | [.pdf](https://github.com/edrubin/EC524W26/blob/master/lecture/004/slides.pdf) | [.Rmd](https://github.com/edrubin/EC524W26/blob/master/lecture/004/slides.Rmd) **Readings** - *ISL* Ch3 - *ISL* Ch6.1 **In between: `tidymodels`-ing** - [An introduction to preprocessing with `tidymodels`](https://www.kaggle.com/edwardarubin/intro-tidymodels-preprocessing). (Kaggle notebook) - [An introduction to modeling with `tidymodels`](https://www.kaggle.com/edwardarubin/intro-tidymodels-modeling). (Kaggle notebook) - [An introduction to resampling, model tuning, and workflows with `tidymodels`](https://www.kaggle.com/edwardarubin/intro-tidymodels-resampling) (Kaggle notebook) - [Introduction to `tidymodels`: Follow up for Kaggle](https://www.kaggle.com/edwardarubin/intro-tidymodels-split-kaggle) [**005 - Shrinkage methods**](https://raw.githack.com/edrubin/EC524W26/master/lecture/005/slides.html) (AKA: Penalized or regularized regression) 1. Ridge regression 1. Lasso 1. Elasticnet **Formats** [.html](https://raw.githack.com/edrubin/EC524W26/master/lecture/005/slides.html) | [.pdf](https://github.com/edrubin/EC524W26/blob/master/lecture/005/slides.pdf) | [.Rmd](https://github.com/edrubin/EC524W26/blob/master/lecture/005/slides.Rmd) **Readings** - *ISL* Ch4 - *ISL* Ch6 [**006 - Classification intro**](https://raw.githack.com/edrubin/EC524W26/master/lecture/006/slides.html) 1. Introduction to classification 1. Why not regression? 1. But also: Logistic regression 1. And maximum likelihood estimation 1. Assessment: Confusion matrix, assessment criteria, ROC, and AUC **Formats** [.html](https://raw.githack.com/edrubin/EC524W26/master/lecture/006/slides.html) | [.pdf](https://github.com/edrubin/EC524W26/blob/master/lecture/006/slides.pdf) | [.Rmd](https://github.com/edrubin/EC524W26/blob/master/lecture/006/slides.Rmd) **Readings** - *ISL* Ch4 - *ISL* Ch6 **Bonus** Two [nice](https://blog.skz.dev/gradient-descent) [interactive](https://towardsdatascience.com/a-visual-explanation-of-gradient-descent-methods-momentum-adagrad-rmsprop-adam-f898b102325c/) visualizations of gradient descent (and related algorithms)—and a mildly related [game](https://www.i-am.ai/gradient-descent.html). [**007 - Decision trees**](https://raw.githack.com/edrubin/EC524W26/master/lecture/007/slides.html) 1. Introduction to trees 1. Regression trees 1. Classification trees—including the Gini index, entropy, and error rate **Formats** [.html](https://raw.githack.com/edrubin/EC524W26/master/lecture/007/slides.html) | [.pdf](https://github.com/edrubin/EC524W26/blob/master/lecture/007/slides.pdf) | [.rmd](https://github.com/edrubin/EC524W26/blob/master/lecture/007/slides.rmd) **Readings** - *ISL* Ch8.1–Ch8.2 [**008 - Ensemble methods**](https://raw.githack.com/edrubin/EC524W26/master/lecture/008/slides.html) 1. Introduction 1. Bagging 1. Random forests 1. Boosting **Formats** [.html](https://raw.githack.com/edrubin/EC524W26/master/lecture/008/slides.html) | [.pdf](https://github.com/edrubin/EC524W26/blob/master/lecture/008/slides.pdf) | [.rmd](https://github.com/edrubin/EC524W26/blob/master/lecture/008/slides.rmd) **Readings** - *ISL* Ch8.2 [**009 - Support vector machines**](https://raw.githack.com/edrubin/EC524W26/master/lecture/009/slides.html) 1. Hyperplanes and classification 2. The maximal margin hyperplane/classifier 3. The support vector classifier 4. Support vector machines **Formats** [.html](https://raw.githack.com/edrubin/EC524W26/master/lecture/009/slides.html) | [.pdf](https://github.com/edrubin/EC524W26/blob/master/lecture/009/slides.pdf) | [.rmd](https://github.com/edrubin/EC524W26/blob/master/lecture/009/slides.rmd) **Readings** - *ISL* Ch9 [**010 - Unsupervised learning, dimensionality reduction, and image classification**](https://raw.githack.com/edrubin/EC524W26/master/lecture/010/slides.html) 0. MNIST dataset (machines with vision) 1. *K*-means clustering 2. Principal component analysis (PCA) 3. UMAP **Readings** - *ISL* Ch12 **Formats** [.html](https://raw.githack.com/edrubin/EC524W26/master/lecture/010/slides.html) | [.pdf](https://github.com/edrubin/EC524W26/blob/master/lecture/010/slides.pdf) | [.rmd](https://github.com/edrubin/EC524W26/blob/master/lecture/010/slides.rmd) Also: An older notebook... [.html](https://raw.githack.com/edrubin/EC524W25/master/lecture/010/notebook.html) | [.qmd](https://github.com/edrubin/EC524W22/blob/master/lecture/010/notebook.qmd) [**011 - A quick introduction to neural networks**](https://raw.githack.com/edrubin/EC524W26/master/lecture/011/slides.html) 1. anatomy of a single neuron 2. logistic regression as a one-neuron network 3. activation functions and hidden layers 4. a brief overview of training 5. the return of MNIST **Readings** - [NNs and Deep Learning](http://neuralnetworksanddeeplearning.com/) Ch1 (some 2) - *ISL* 10 (*Deep Learning*) **Formats** [.html](https://raw.githack.com/edrubin/EC524W26/master/lecture/011/slides.html) | [.pdf](https://github.com/edrubin/EC524W26/blob/master/lecture/011/slides.pdf) | [.rmd](https://github.com/edrubin/EC524W26/blob/master/lecture/011/slides.rmd) ## Interesting ML/AI applications Starting in week 2, you will submit brief write-ups for machine-learning/AI applications that you find interesting. These nine write-ups together will count for a single "project" grade. Submit by Monday at 11:59p (Pacific) each week (on Canvas): - What is the application? - What kind of prediction problem is it? - What ML/AI methods are they using? - Why is this interesting/useful? - URL/file for the article or post. The "coolest" applications will be highlighted in class and will receive extra credit. **Week 2** - [Youtube's recommendation algorithm](https://medium.com/techtalkers/how-youtube-knows-what-you-want-to-watch-212a24d79f49) - [AI detection of tumors in CT scans](https://www.nytimes.com/2026/01/02/world/asia/china-ai-cancer-pancreatic.html) - [Google's species identification AI](https://techcrunch.com/2025/03/03/google-releases-speciesnet-an-ai-model-designed-to-identify-wildlife/) - [AI plays video games](https://www.sciencedirect.com/science/article/pii/S0957417425008735) (and many others, e.g., [here](https://www.youtube.com/watch?v=QOJfyp0KMmM)) **Week 3** - New ML/AI approaches boost [weather](https://deepmind.google/blog/graphcast-ai-model-for-faster-and-more-accurate-global-weather-forecasting/) and [flood](https://news.agu.org/press-release/ai-boosts-national-weather-model-flood-prediction-accuracy-sixfold/) prediction/forecast accuracy. - [Predicting political leaning with Facebook activity](https://repository.uantwerpen.be/docman/irua/e7ffcf/155787.pdf) (maybe broke the world). - [Claude Code](https://www.removepaywall.com/search?url=https://nymag.com/intelligencer/article/how-claude-code-cowork-reset-the-ai-assistant-race.html) seems good. - [A finace paper about generating finance papers with AI](https://www.nber.org/system/files/working_papers/w33363/w33363.pdf) (insert finance joke here). **Week 4** - Wildfire fuel [mapping](https://www.sciencedirect.com/science/article/pii/S1569843225000834?fr=RR-2&rr=9c7ccb1a1cc63e6d) - Wearable fitness trackers to [predict cardiovascular events](https://www.sciencedirect.com/science/article/pii/S2666667725000819?via%3Dihub) **Week 5** Insurance week! - [Logistic regression vs. boosting for insurance claims](https://www.mdpi.com/2227-9091/7/2/70) - [A bunch of algorithms for life (insurance) risk](https://link.springer.com/article/10.1007/s40747-018-0072-1) **Week 6** ML-driven matching. - ML to [reunite separated families](https://insights.som.yale.edu/insights/machine-learning-model-can-help-reunite-long-separated-families) - Uber's [approach](https://www.geeksforgeeks.org/system-design/how-uber-finds-nearby-drivers-at-1-million-requests-per-second/) to matching riders and drives **Week 7** Audits. - [Tax audits](https://www.nber.org/system/files/working_papers/w30777/w30777.pdf) and [poverty prediction](https://www.science.org/doi/10.1126/science.aaf7894) with ML. - NBER working paper: [Predicting policy misconduct](https://www.nber.org/system/files/working_papers/w32432/w32432.pdf). **Week 8** More (nuanced?) audits and outlier detection. - An accounting firm on the [promise and pitfalls of AI and audits](https://www.btcpa.net/insights/how-ai-is-changing-irs-audits-promise-and-pitfalls). - Using outliers in high dimensions to [measure partisanship](https://doi.org/10.3982/ECTA16566). - [NBER working paper](https://www.nber.org/system/files/working_papers/w32705/w32705.pdf) on the difference between out-of-sample performance and in-the-field performance (applied to *bogus* firms). ## Projects Past, present, and future projects. **Example** [Using `tidymodels` (and `tidyverse`)](https://raw.githack.com/edrubin/EC524W26/master/projects/project-001/example.html) with the Chicago housing data. **000** An introduction to prediction and resampling - [Instructions](projects/project-000/README.md) - [Data](projects/project-000/sales-data.fst) - _Due:_ 20 January 2026 **001** Cross validation and penalized regression - [Instructions](https://raw.githack.com/edrubin/EC524W26/master/projects/project-001/README.html) (also in [plain Github markdown](projects/project-001/README.md)) - [Data](projects/project-000/sales-data.fst) - _Due:_ 28 January 2026 **002** Classification - [Instructions](projects/project-002/README.md) - [Data](https://github.com/edrubin/EC524W26/blob/master/projects/project-002/data-churn.csv) - _Due:_ 17 February 2026 **003** Trees, ensembles, and boosting - [Instructions](projects/project-003/README.md) - [Data](https://github.com/edrubin/EC524W26/blob/master/projects/project-003/data-churn.csv) - _Due:_ 03 March 2026 **004** Prediction finale (cancelled) ## Class projects [**Class project 01: Application**](https://github.com/edrubin/EC524W26/tree/master/projects/class-project-01)
*Selected topic due by 30 January 2026*
*Project due 04 March 2026* [**Class project 02: Extension**](https://github.com/edrubin/EC524W26/tree/master/projects/class-project-02)
*Selected topic due by 13 February 2026*
*Project due 11 March 2026* ## Final exam **In-class exam**: *Tuesday (17 March 2026) at [8:00a–10:00a](https://registrar.uoregon.edu/dates-deadlines/exams)*
*Note:* Some previous years had a take-home portion of the final exam. This year, we will only have an in-class exam. **Prep materials**
Previous in-class exams: [2023](exam/past-class/inclass-23.pdf) | [2024](exam/past-class/inclass-24.pdf) | [2025](exam/past-class/inclass-25.pdf)
Previous take-home exam: [2023](exam/past-home/home-23.md) | [2024](exam/past-home/home-24.md)
*Note:* We will not provide keys. ## Lab notes Approximate/planned topics... or at least for reference... [**00 - RStudio Review**](https://raw.githack.com/edrubin/EC524W22/master/lab/000-cleaning/000-slides.html) 1. General "best practices" for coding 2. Working with RStudio 3. The pipe (`%>%`) 4. Cleaning and Kaggle follow up **Formats** [.html](https://raw.githack.com/edrubin/EC524W22/master/lab/000-cleaning/000-slides.html) | [.pdf](https://raw.githack.com/edrubin/EC524W22/master/lab/000-cleaning/000-slides.pdf) | [.Rmd](https://raw.githack.com/edrubin/EC524W22/master/lab/000-cleaning/000-slides.Rmd) [**01 - Workflow and Resampling**](https://rawcdn.githack.com/edrubin/EC524W26/0e4e86229decd603823a4f1d93f7fbe74994054c/lab/02-workflow-and-sampling/slides/w02-lab-workflow-and-sampling.html#/title-slide) 1. Install Quarto. Follow this [link](https://quarto.org/docs/getting-started/installation.html), download the installer for your operating system, and follow the instructions to install Quarto 2. Download (_and unzip_) the [Lab Files](https://github.com/edrubin/EC524W26/blob/master/lab/02-workflow-and-sampling/02-lab.zip?raw=true) 3. Create a project in Rstudio in a separate folder 4. Copy/move the **Lab Files** to a folder dedicated to this lab 5. Open the Quarto document in Rstudio and follow the instructions **Formats** [.html](https://rawcdn.githack.com/edrubin/EC524W26/0e4e86229decd603823a4f1d93f7fbe74994054c/lab/02-workflow-and-sampling/slides/w02-lab-workflow-and-sampling.html#/title-slide) | [.pdf](https://rawcdn.githack.com/edrubin/EC524W26/33c0d7eda7675ebeba7abc0645cf7890f6b50198/lab/02-workflow-and-sampling/slides/w02-lab-workflow-and-sampling.pdf) | [.qmd](https://github.com/edrubin/EC524W26/blob/master/lab/02-workflow-and-sampling/slides/w02-lab-workflow-and-sampling.qmd) [**02 - Introduction to `tidymodels`**](https://rawcdn.githack.com/edrubin/EC524W26/ca984bd356099678a8651dc3387f971f51803e28/lab/03-tidymodels/slides/w03-tidymodels-i.html#/title-slide) 1. Download the [Lab File](https://github.com/edrubin/EC524W26/blob/master/lab/03-tidymodels/lab-03.qmd) 2. We will learn about cleaning data quickly and efficiently with `tidymodels` **Formats** [.html](https://rawcdn.githack.com/edrubin/EC524W26/ca984bd356099678a8651dc3387f971f51803e28/lab/03-tidymodels/slides/w03-tidymodels-i.html#/title-slide) [**03 - More `tidymodels`**](https://rawcdn.githack.com/edrubin/EC524W26/b954c985ec272abc1503dc6e7297f87e28e3c197/lab/04-tidymodels-2/slides/w04-tidymodels-ii.html#/title-slide) [**04 - Classification**](https://github.com/edrubin/EC524W26/blob/master/lab/05-classification/lab05.qmd) ## Additional resources ### Jobs I wrote a very short guide to [finding a job](jobs). For programming-related jobs, get some practice on - [LeetCode](https://leetcode.com/) - [StataScratch](https://www.stratascratch.com/) - [Kaggle](https://www.kaggle.com/) - [Codewars](https://www.codewars.com/) - [HackerRank](https://www.hackerrank.com/) ### R - [UO library resources/workshops](https://researchguides.uoregon.edu/library_workshops) - [RStudio's recommendations for learning R](https://education.rstudio.com/learn/), plus cheatsheets, books, and tutorials - [YaRrr! The Pirate’s Guide to R](https://bookdown.org/ndphillips/YaRrr/) (free online) - [Advanced R](https://adv-r.hadley.nz/) (free online) - [R for Data Science](https://r4ds.had.co.nz/) (free online) - [R Graphics Cookbook](https://r-graphics.org/) (free online) - [Data Visualization](https://socviz.co/) (free online) ### SQL - [Learn SQL with interactive exercises](https://sqlbolt.com/) - [Mode SQL Tutorial](https://mode.com/sql-tutorial/) - [W3Schools SQL Tutorial](https://www.w3schools.com/sql/) ### Data Science - [Happy Git and GitHub for the useR](https://happygitwithr.com/) by Jenny Bryan, the "STAT 545 TAs", and Jim Hester - [Python Data Science Handbook](https://jakevdp.github.io/PythonDataScienceHandbook/) by Jake VanderPlas - [Elements of AI](https://course.elementsofai.com/) - [Caltech professor Yaser Abu-Mostafa: Lectures about machine learning on YouTube](https://www.youtube.com/user/caltech/search?query=Yaser+Abu-Mostafa) - From Google: - [Machine-learning crash course](https://developers.google.com/machine-learning/crash-course/ml-intro) - [Google Cloud training for data and machine learning](https://cloud.google.com/training/data-ml) - [General Google education platform](https://ai.google/education/) - [3Blue1Brown's Youtube channel](https://www.youtube.com/c/3blue1brown) (has great videos on neural networks and other math topics) - [Fast.ai](https://www.fast.ai/) (free online courses on deep learning and machine learning) ### Spatial data - [Geocomputation with R](https://geocompr.robinlovelace.net) (free online) - [Spatial Data Science](https://r-spatial.org/book/) (free online) - [Applied Spatial Data Analysis with R](https://asdar-book.org)