**CPSC 532Y: Causal Machine Learning** **Instructor**: [Mathias Lécuyer](https://mathias.lecuyer.me) **Schedule**: MW 10:00-11:20 -- Term 1 (September - December 2024) **Location**: [SWNG 210](https://maps.ubc.ca/?code=SWNG) (the class is in person) **Office Hours**: right after class. **Logistics**: Logistics and discussions will happen on Piazza [^piazza]. You can [login through Canvas here](https://canvas.ubc.ca/courses/155998/). **If you want to audit or attend the first sessions, please feel free to join**. Every UBC student should be able to access Canvas for now. **Previous offerings**: while anything might change, this session will be similar to previous offerings [2023w1](previous_offerings/2023w1), [2022w1](previous_offerings/2022w1). Objectives ========== This class has two main educational goals: 1. Cover the basics of causal inference, including: a. The Potential outcome framework ("Rubin model") b. The Causal Graph framework ("Pearl model") c. Goals of causal inference, and core techniques 2. Introduce recent developments using Machine Learning (ML) to extend the core techniques, and address some of their limitations. Topics include: a. Using ML to estimate heterogeneous causal effects, including in regression (meta learners, random forests, orthogonal learning…) and IV settings (deep-IV, method of moments). b. Evaluating Causal ML models. We will cover these topics trough a mix of lectures, paper readings, and in class discussions of the material. **This is a graduate seminar, and all students are expected to be actively involved during lectures and paper discussions. The grading with reflect these expectations.** Prerequisites ============= While there is no formal requirement to allow anyone to take the class, general, basic background on the following topics is assumed: probability, statistics, and Machine Learning. The assignment and mini-project will also require the ability to program in python. It should be very possible for a motivated student to learn any missing background on their own as the class progresses (and students with missing background knowledge are expected to). Evaluation ========== Your course grade will be based on (potentially a subset of) the following: in class participation, assignments, project. Paper Readings ============== Reaging all assigned papers, as well as regular discussion participation, is required and part of the grade. When reading a paper, focus on: - The formal causal question addresses by the paper. - The core challenges and main contributions (how they solve the challenges). - Data settings / assumptions / models, and examples of what applying the approach looks like. To encourage informed and lively discussions, before each class with a paper discussion you are required to submit a short write-up that highlights: - What you think is main take-away of the paper. - One **specific** point that you liked or disliked or have questions on. It needs to be specific (e.g., not "there was too much math" or "it was hard to read"), and not too obscure (e.g., not "I didn't get this line in the proof," though we can discuss specifics about results and their proofs in class). As concrete examples, it could be about the meaning or validity of a hypothesis. **Deliverable**: A pdf, written in latex, **emailed to my UBC email with subject [532Y reading] your-name and lecture date**. One or two paragraphs. **Due date**: Before the class during which we discuss the paper. Assignments =========== Assignment 1 ------------ In the first assignment, you will create a data setting that demonstrates the pitfalls of causal inference, and some solutions. 1. Create a generative data model that illustrates the challenges of causal inference (i.e. when "naive" observational estimators are different from causal ones). Make sure to explicitely state the causal effect of interest. Be concise by precise when describing your model (e.g., use notation such as x ~ N(0, 1) to define the variables and their relationships). 2. Using the potential outcomes framework, show theoretically that the "naive" observational estimator (difference of conditional expectations) is biased. 3. Empirically demonstrate this bias by implementing your generative data model and showing (at least) one plot demonstrating the issue. 4. Give at least two estimators that exactly identify the causal effect. What assumptions do this estimators rely on? Why are those assumptions verified in your model? Prove identification under those assumptions. 5. Implement those estimators and demonstrate using plots that they correctly identify the causal effect of interest. **Deliverable**: A pdf, written in latex, **emailed to my UBC email with subject [532Y HW1] your-name**. **At most 2 pages, including plots and formulas** (less is more). **Due date**: Oct. 1, 2024. Assignment 2 ------------ In the second (and last) assignment, you will create a data setting that demonstrates the pitfalls of fitting CATE models, and some solutions. 1. Create a generative data model that illustrates the challenges of causal inference: make sure to explicitely state you causal model (you can use plots for complex functions and other parts to make the communication clear and precise). 2. On this model, implement a "naive" CATE model (potentially using a meta-algorithm that combines several mdoels) to empirically demonstrate the challenges of convergence. Show one version that does not converge to the CATE, and one the converges slowly. Use plots of the fit, as well as plots of the relevant error as a function of dataset size, to make your point. 3. Explain the intuition for why your data model creates those challenges, due to its interaction with your model class (this does not need to be fully formal, but consider using counterfactual notation to make your point---don't be too lengthy!). 4. Show an orthogonal ML version that will converge faster. Briefly explain why based on the paper's results (no need to re-derive results in the paper! but be as formal as you can). 5. Implement this orthogonal ML approach with model classes of your choice (justify those choices), and show plots for how this impacts your results compared to the approach in 2. **Deliverable**: A pdf, written in latex, **emailed to my UBC email with subject [532Y HW2] your-name**. **At most 3 pages, including plots and formulas** (less is more). **Due date**: Nov. 5, 2024. Syllabus ======== See [what we covered last year](previous_offerings/2023w1/#schedule). Schedule -------- 4 Sep 2024: Introduction: Why Causal Inference? 9 Sep 2024: The Potential Outcomes framework (lecture) Definitions and notations. 11 Sep 2024: The Potential Outcomes framework (lecture) Concept: Identifiability. Assumptions: (conditional) ignorability. Techniques and intuition: randomization. 16 Sep 2024: The Potential Outcomes framework (lecture) Identifiability without randomization, estimation, heterogeneity. Confidence intervals. 18 Sep 2024: Linear regression for causal inference (lecture) Basic facts, interpretation(s) as an estimator for the ATE (using potential outcomes), confidence intervals. 23 Sep 2024: Linear regression and Propensity Scores (lecture) Finish linear regression, start on propensity scores. 25 Sep 2024: Propensity Scores (lecture) Identification through conditioning on the propensity. Eestimators: Iverse Propensity Scores; Doubly Robust estimators. 30 Sep 2024: 🌴 *No Class* National Day for Truth and Reconciliation 1 Oct 2024: ⚠️ Assignement 1 due [Assignment 1](#a1) is due. Deliverable: a pdf, written in latex, **emailed to my UBC email with subject [532Y HW1] your-name**. **At most 2 pages, including plots and formulas** (less is more). 2 Oct 2024: Causal Decision Trees (paper) [Recursive Partitioning for Heterogeneous Causal Effects (Athey, Imbens, 2013/2015)](https://arxiv.org/abs/1504.01132). [**See guidelines and deliverable here**](#paperreadings). 7 Oct 2024: Meta-learners (paper) [Meta-learners for Estimating Heterogeneous Treatment Effects using Machine Learning (Künzel, Sekhon, Bickel, Yu, 2019)](https://arxiv.org/abs/1706.03461). [**See guidelines and deliverable here**](#paperreadings). 9 Oct 2024: Orthogonal Learning (paper) [Orthogonal Statistical Learning](https://arxiv.org/pdf/1901.09036), up to and **including** section 3. Pay attention to the examples (and ideally associated proofs in appendix!). [**See guidelines and deliverable here**](#paperreadings). 14 Oct 2024: 🌴 *No Class* Thanksgiving Day 16 Oct 2024: Orthogonal Learning (paper) We will continue the discussion of the [Orthogonal Learning](#schedule1_2024-10-9) paper. 21 Oct 2024: Review Session [Post topics/questions on Piazza](https://piazza.com/class/m0n0fzottdo637/post/14). 22 Oct 2024: ⚠️ Submit a project idea [optional] Optional but encouraged! I'll send (short) feedback, and it's an opportunity to chat about it before the deadline too. You can submit with a group (groups of 1 to 4 are fine--if you have a good reason to do a larger group let me know), or form a group later. If you decide to do it, **email me your pitch with subject [532Y project]**. Make sure to include the group in the email if you already have one. 23 Oct 2024: Structural Causal Models (lecture) Definitions: DAGs, SCMs, Do(). 28 Oct 2024: Structural Causal Models (lecture) Definitions: DAG structures. 30 Oct 2024: Structural Causal Models (lecture) Backdoor criterion, do-calculus. 4 Nov 2024: Structural Causal Models (lecture) Using do-Calculus, Counterfactuals 6 Nov 2024: Structural Causal Models (lecture) Ladder of Causation, PNS 8 Nov 2024: ⚠️ Project group and proposal Deliverable: a pdf, written in latex, **emailed to my UBC email with subject [532Y Project] names of group members**. A **short** (one paragraph) abstract for your project. Make sure you define the causal question, causal strategy, and expected outcomes (that last one doesn't need to be precise but it'll help you). You can add other details and formalism (up to 2 pages total) if you want feedback. 11 Nov 2024: 🌴 *No Class* Remembrance Day and Midterm Break 13 Nov 2024: 🌴 *No Class* Midterm Break 18 Nov 2024: Instrument Variables and RDDs (lecture) TBD 19 Nov 2024: ⚠️ Assignement 2 due [Assignment 2](#a2) is due. Deliverable: a pdf, written in latex, **emailed to my UBC email with subject [532Y HW2] your-name**. **At most 3 pages, including plots and formulas** (less is more). 20 Nov 2024: IV with Deep Learning (papers) [DeepIV](https://proceedings.mlr.press/v70/hartford17a/hartford17a.pdf) and [Deep Generalized Method of Moments](https://arxiv.org/abs/1905.12495). [**See guidelines and deliverable here**](#paperreadings). 25 Nov 2024: Causal Inference with Cocycles (paper) [Causal Inference with Cocycles](https://arxiv.org/abs/2405.13844). Guest lecture by Benjamin Bloem-Reddy. [**See guidelines and deliverable here**](#paperreadings). 27 Nov 2024: Sensitivity analysis (paper) [Sense and Sensitivity Analysis](https://proceedings.neurips.cc/paper/2020/hash/7d265aa7147bd3913fb84c7963a209d1-Abstract.html) [**See guidelines and deliverable here**](#paperreadings). 2 Dec 2024: Project presentations Group order TBD 4 Dec 2024: Project presentations Group order TBD [^piazza]: In this course, you will be using Piazza, which is a tool to help facilitate discussions. When creating an account in the tool, you will be asked to provide personally identifying information. Because this tool is hosted on servers in the U.S. and not in Canada, by creating an account you will also be consenting to the storage of your information in the U.S. Please know you are not required to consent to sharing this personal information with the tool, if you are uncomfortable doing so. If you choose not to provide consent, you may create an account using a nickname and a non-identifying email address, then let your instructor know what alias you are using in the tool.