S&DS 265 — Introductory Machine Learning
Lecture notes for a modern introduction to machine learning, deep learning, and AI systems
Overview
S&DS 265 — Introductory Machine Learning
Lecture Notes
Machine learning begins when the answer is not already stored in the data: we have observed cases, we face a new one, and we need a prediction, representation, generation, or decision that stays useful beyond the sample it was built from. That is possible only when the data carry structure forward — a response following a trend, a high-dimensional observation governed by a few components, images with reusable local patterns, sequences with relationships attention can find. Each assumption suggests a model; the model and loss create a training problem; the fitted model becomes an inference procedure. These notes follow that chain from small regression models through generative models, reinforcement learning, and language models, to agents.
Course Flow
The mathematical and computational preparation in Lectures 1–2 supports all four domains. Later parts reuse ideas from earlier ones rather than replacing them.
Course Overview
Orientation and technical language
- 1. Introduction to Machine Learning — What makes a question a learning problem? We begin with unseen cases, identify the roles of data, structural assumptions, models, losses, training, inference, and evaluation, and distinguish optimization success from evidence of generalization.
- 2. Mathematical Language for Machine Learning — Vectors, projections, matrix decompositions, derivatives, computation graphs, probability, and Gaussians become a common language for stating models and checking implementations.
Regression
- 3. Linear Regression — Least squares is developed as a complete learning problem: a linear structural assumption, a squared-error objective, normal equations, projection geometry, statistical interpretation, and honest evaluation.
- 4. Regularized Regression — Ridge and lasso stabilize an ill-conditioned fit, express different assumptions about coefficients, and turn model choice into a validation problem.
- 5. Gradient Descent and Stochastic Optimization — When a closed-form solution is inconvenient or the data are too large for a full pass, iterative optimization trades exact steps for scalable computation.
- 6. Nonlinear Regression — Basis expansions, splines, local smoothers, and generalized additive models relax the straight-line assumption while keeping interpretation and generalization in view.
Classification and tree models
- 7. Generative Classification — Bayes’ rule turns class priors and class-conditional distributions into decisions; LDA and QDA show how covariance assumptions determine the boundary.
- 8. Logistic Classification — A discriminative probability model links linear scores to calibrated class probabilities and a cross-entropy training objective.
- 9. Margin Classification — Separating hyperplanes, margins, hinge loss, kernels, and regularization explain why the support vector machine depends on a small set of consequential observations.
- 10. Trees and Ensembles — Trees partition feature space through conditional questions; bagging, random forests, and boosting turn unstable individual trees into strong predictors.
Neural networks and training
- 11. Multilayer Perceptrons and Backpropagation — Composing affine maps and nonlinearities creates learned features; reverse-mode differentiation makes the resulting model trainable.
- 12. Neural-Network Optimization — Initialization, normalization, residual connections, momentum, adaptive methods, schedules, and diagnostics address the geometry and noise of deep-network training.
- 13. Convolutional Neural Networks — Local connectivity and weight sharing encode image structure, from convolution arithmetic through modern residual architectures and transfer learning.
Representation and latent structure
- 14. PCA and Low-Rank Structure — Principal components find directions that preserve variance and minimize reconstruction error, turning the SVD into a method for compression, visualization, and denoising.
- 15. Clustering — K-means, hierarchical clustering, and related methods formalize different meanings of a group and reveal how strongly conclusions depend on scale and distance.
- 16. Latent Variables and EM — Mixture models make cluster uncertainty explicit, while the EM algorithm alternates between inferring hidden assignments and refitting parameters.
- 17. Autoencoders, VAEs, and VQ-VAEs — Neural encoders and decoders learn continuous or discrete latent spaces; probabilistic regularization turns reconstruction into a generative model.
Diffusion models
- 18. Diffusion Models — A forward process gradually destroys structure with noise; denoising and score learning make it possible to construct a reverse process that generates data.
- 19. Latent Diffusion and Flow Matching — Moving the process into a learned latent space reduces cost, while probability-flow ODEs and flow matching provide a deterministic transport view of generation.
Reinforcement learning
- 20. Reinforcement-Learning Foundations — Markov decision processes, value functions, Bellman equations, dynamic programming, and temporal-difference learning formalize prediction and control under sequential feedback.
- 21. Policy Optimization — Policy gradients, baselines, actor–critic methods, importance ratios, and PPO turn long-run return into a trainable objective while controlling unstable updates.
Language models and AI systems
- 22. Language Models and Transformers — Next-token prediction, embeddings, attention, the transformer block, scaling, and decoding explain how a sequence model is trained and used.
- 23. LLM Posttraining — Instruction tuning, preference data, reward models, DPO, RLHF, and verifiable rewards reshape a pretrained model’s behavior and expose new evaluation problems.
- 24. LLM Systems and Agents — Retrieval, tool use, memory, planning, context management, orchestration, safety, and end-to-end evaluation turn a language model into a larger problem-solving system.
Reading and working with the notes
The lecture pages are written as reading chapters. A chapter begins with the obstacle that motivates a method, develops the mechanism with mathematics and figures, tests it in a worked example, and examines characteristic failures. Some derivations and appendices are intended for study outside class and need not all be covered during the meeting.
Acknowledgements
These notes benefited from several courses covering similar material:
- IEMS 305: Foundations of Modern Machine Learning at Northwestern, taught by Zhaoran Wang
- CS 189: Introduction to Machine Learning at Berkeley
- Earlier versions of S&DS 265 at Yale
Three textbooks serve as companions throughout, all of them free online:
- An Introduction to Statistical Learning with Applications in Python (ISLP), James, Witten, Hastie, Tibshirani, and Taylor — the classical supervised-learning chapters
- Dive into Deep Learning (D2L), Zhang, Lipton, Li, and Smola — implementation, and the neural-network material
- Deep Learning (DL), Goodfellow, Bengio, and Courville — the mathematical background, and depth beyond what a lecture can hold
Course-specific derivations, examples, figures, and diagnostics are added throughout.