Materials for a short course introducing machine learning and AI methods to social scientists: prediction and the ML toolkit (Day 1), and machine learning for causal inference (Day 2).
ML Primer.pdf— Day 1 slides.ML and Causal Inference.pdf— Day 2 slides.Python code/,R Code/,Stata Code/— code reproducing the examples in each language. Most examples appear in all three; some are single-language. Each directory has arun_allscript.Data/— the baseline (source) data the examples read. Larger intermediate outputs are regenerated by running the code.map of code to material.xlsx— which code files correspond to which section of the notes.Note on Software for Lectures.txt— start here to set up Python (via Anaconda), Stata, and/or R.
- Read
Note on Software for Lectures.txt. - Create the shared Python environment:
conda env create -f environment.yml. - Run the code in your language of choice.
All three languages share one Python environment (mlssshort); Stata's Python
integration and R's reticulate both call into it. See the software note for
details.