Meeting time and recorded lectures

Stats 202 meets MWF 1:30-2:20 pm in Skilling Auditorium.

All lectures will be recorded on video by the Stanford Center for Professional Development and posted here.

Course description

Stats 202 is an introduction to Data Mining. By the end of the quarter, students will:

  • Understand the distinction between supervised and unsupervised learning and be able to identify appropriate tools to answer different research questions.
  • Become familiar with basic unsupervised procedures including clustering and principal components analysis.
  • Become familiar with the following regression and classification algorithms: linear regression, ridge regression, the lasso, logistic regression, linear discriminant analysis, K-nearest neighbors, splines, generalized additive models, tree-based methods, and support vector machines.
  • Gain a practical appreciation of the bias-variance tradeoff and apply model selection methods based on cross-validation and bootstrapping to a prediction challenge.
  • Analyze a real dataset of moderate size using a combination of R and Python.
  • Develop the computational skills for data wrangling, collaboration, and reproducible research.
  • Be exposed to other topics in machine learning, such as missing data, prediction using time series and relational data, non-linear dimensionality reduction techniques, web-based data visualizations, anomaly detection, and representation learning.


Introductory courses in statistics or probability (e.g., Stats 60), linear algebra (e.g., Math 51), and computer programming (e.g., CS 105).

Staff and office hours

Consult this table for up-to-date office hour information.

Office hours Location
Instructor Lester Mackey Wednesday 2:30-4:30 pm Sequoia 141


The only textbook required is An Introduction to Statistical Learning with applications in R by Gareth James, Daniela Witten, Trevor Hastie, and Robert Tibshirani (Springer, 1st ed., 2013).

The book is available at the Stanford Bookstore and free online through the Stanford Libraries. A hard copy of the book is in the reserves of the Mathematics and Statistics Library.


  • Midterm exam: Monday, October 26, 1:30 to 2:20 pm (in class).
  • Final exam: TBD.

If for extenuating circumstances you cannot take the midterm on Oct. 26, you must email us by Oct. 14. Since the midterm is during class, we cannot guarantee an opportunity to make it up.

The final exam is mandatory. If you cannot take it at the time indicated above, please drop the class.

SCPD students will have to complete each exam in the amount of time specified and return it to SCPD within 24 hours of the time of the exam at Stanford.


There will be 7 graded homework assignments, due at the start of class on the day indicated.

This quarter, we will be trying an online submission and scoring system called Scoryst, which was developed by Stanford students. Homeworks will be submitted as PDF files on this website. Enroll in our site using the link on the header of each homework.

All regrade requests should be submitted to Please, read the solutions to the homework before sending a request and specify (1) the part(s) of the homework you believe were wrongly graded and (2) why you deserve full or partial credit.

Late homework will not be accepted, but the lowest homework score will be ignored.

Kaggle competition

An important part of the class will be a quarter-long prediction challenge hosted by Kaggle. This competition will allow you to apply the concepts learned in class and develop the computational skills to analyze data in a collaborative setting.

To learn more about the competition see the link on the left.


  • Homework: 40% (lowest score dropped).
  • Midterm: 20%.
  • Final: 35%.
  • Kaggle competition: 5% (based on satisfactory participation).

The 3 teams who obtain the highest score in the Kaggle competition will be given the option of not taking the final exam (!). Their class grade would be based on midterm and homework scores alone.


Day Topic Chapters Homework
Mon 9/21 Class logistics, HW 0 HW 0 out
Wed 9/23 Supervised and unsupervised learning 2 HW 1 out
Fri 9/25 Principal components analysis 10.1,10.2,10.4 HW 0 due
Mon 9/28 Clustering 10.3, 10.5
Wed 9/30 Linear regression 3.1-3.3 HW 1 due, HW 2 out
Fri 10/02 Linear regression 3.3-3.6
Mon 10/05 Classification, logistic regression 4.1-4.3
Wed 10/07 Linear discriminant analysis 4.4-4.5 HW 2 due, HW 3 out
Fri 10/09 Classification lab 4.6
Mon 10/12 Cross validation 5.1
Wed 10/14 The Bootstrap 5.2-5.3 HW 3 due, HW 4 out
Fri 10/16 Regularization 6.1, 6.5
Mon 10/19 Shrinkage 6.2
Wed 10/21 Shrinkage lab 6.6 HW 4 due
Fri 10/23 Dimension reduction 6.3, 6.7
Mon 10/26 Midterm exam
Wed 10/28 Splines 7.1-7.4 HW 5 out
Fri 10/30 Smoothing splines, GAMs, Local regression 7.5-7.7
Mon 11/02 Non-linear regression lab 7.8
Wed 11/04 Decision trees 8.1, 8.3.1-2 HW 5 due, HW 6 out
Fri 11/06 Bagging, random forests, boosting 8.2, 8.3.3-4
Mon 11/09 Support vector machines 9.1-9.2
Wed 11/11 Support vector machines 9.3-9.5 HW 6 due, HW 7 out
Fri 11/13 Support vector machines lab 9.6
Mon 11/16 Non-linear dimensionality reduction
Wed 11/18 Wavelets HW 7 due
Fri 11/20 Data scraping, data wrangling
Mon 11/23 Thanksgiving
Wed 11/25 Thanksgiving
Fri 11/27 Thanksgiving
Mon 11/30 Web visualizations
Wed 12/02 Final review All chapters Kaggle deadline
Fri 12/04 Final review All chapters
Mon 12/07 Final exam

Some important dates:

  • November 13: Deadline to withdraw from the class or change the grading basis.
  • December 04: Last opportunity to arrange an Incomplete.