CS229: Machine Learning

Spring 2020


Course Description   This course provides a broad introduction to machine learning and statistical pattern recognition. Topics include: supervised learning (generative/discriminative learning, parametric/non-parametric learning, neural networks, support vector machines); unsupervised learning (clustering, dimensionality reduction, kernel methods); learning theory (bias/variance tradeoffs, practical advice); reinforcement learning and adaptive control. The course will also discuss recent applications of machine learning, such as to robotic control, data mining, autonomous navigation, bioinformatics, speech recognition, and text and web data processing.


  • 04/03/20 We are currently updating this website for the Spring 2020 version of the course. This annoucement will be removed once we are finished. Stay tuned!
  • 04/03/20 Welcome to CS229! We are excited to get the class started on Monday 4/06 at 4:30pm PST. Because of the ongoing COVID-19 pandemic, this class will be taught entirely online. Links to lectures can be found on Canvas.

  • Course Information

    Time and Location
    MW 4:30pm - 5:50pm PST. The class will be taught online. Links to lectures are on Canvas under Zoom.
    Contact and Communication
    Due to a large number of inquiries, we encourage you to read the logistic section below and the FAQ page for commonly asked questions first, before reaching out to the course staff.
    Piazza is the forum for the class.
    • All official announcements and communication will happen over Piazza.
    • Any questions regarding course content and course organization should be posted on Piazza. You are strongly encouraged to answer other students' questions when you know the answer.
    • If there are private matters specific to you (e.g special accommodations, requesting alternative arrangements etc.), please create a private post on Piazza.
    • For longer discussions with TAs, please attend office hours.
    • TA office hours and the course calendar can be found here.
    • Before the beginning of the course, please contact the course coordinator Swati Dube Batra for logistical questions (ideally after consulting the FAQ page)


    1. Prerequisites
    2. Students are expected to have the following background:
      • Knowledge of basic computer science principles and skills, at a level sufficient to write a reasonably non-trivial computer program in Python/numpy.
      • Familiarity with probability theory (CS 109 or STATS 116)
      • Familiarity with multivariable calculus and linear algebra (relevant classes incldue, but not limited to MATH 51, MATH 104, MATH 113, CS 205, CME 100, CME 103)
    3. Optional Friday Lectures
    4. To review material from the prerequisites or to supplement the lecture material, additional lectures will be held every Friday at 4:30pm - 5:50pm PST (weeks 1-9). Links to the lectures will be on Canvas. Attendance to these lectures is optional, but encouraged.
    5. Optional Discussion Sections
    6. In addition to the regular lectures and optional Friday lecture, there will also be optional weekly discussion sections led by TAs. These sessions are meant to be interactive and in a small, traditional classroom setting. They will largely involve working through problems that are similar to the homeworks. Discussion sections will be held on Thursdays at 10:30am - 11:50am PST, as well as 1:30pm - 2:50pm PST. Links to these discussion sections will be on Canvas.
    7. Course Materials
    8. There is no required text for this course. Notes will be posted periodically on the class syllabus.
    9. Grading
    10. There will be four written homeworks, one midterm, and an optional major open-ended term project (see the projects page for details). The assignments will contain written questions and questions that require some Python programming. In the term project, you will investigate some interesting aspect of machine learning or apply machine learning to a problem that interests you.
      We try very hard to make questions unambiguous, but some ambiguities may remain. Ask if confused or state your assumptions explicitly. Reasonable assumptions will be accepted in case of ambiguous questions.

      Course grades: if you elect to not do the term project, then your grade will be based 66.67% on homeworks (distributed evenly between the four assignments) and 33.33% on the midterm. If you elect to do the term project, then your grade will be based 40% on homeworks (10% each), 20% on the midterm, and 40% on the term project. However, if you submit a term project, we will calculate your grade both ways, and you will receive the higher score. Note: as per University rules, all students will be graded on a S/NC basis this quarter. However, we will still keep track of percentage grades for those students that request it for outside purposes (scholarships, reimbursements etc).
    11. Submitting Assignments
    12. Assignments will be submitted through Gradescope. You will receive an invite to Gradescope for CS229 Machine Learning Spring 2020. If you have not received an invite email after the first few days of class, first log in to Gradescope with your @stanford.edu email and see whether you find the course listed, if not please post a private message on Piazza for us to add you. This quarter, students are allowed to submit in pairs. If you do so, make sure both names are attached to the Gradescope submission.
    13. Late Assignments
    14. Each student will have a total of eight free late (calendar) days to use for homeworks, project proposals and project milestones. Once these late days are exhausted, any assignments turned in late will be penalized 20% per late day. However, no assignment will be accepted more than three days after its due date, and late days cannot be used for the final project poster or write-up. Each 24 hours or part thereof that a homework is late uses up one full late day. Please note that late days are applied individually. If an assignment is submitted late, then each student in the submission is docked the corresponding number of late days (for example, if an assignment is submitted 5 hours late, each student will be docked 1 late day).
    15. Honor Code
    16. We strongly encourage students to form study groups. Students may discuss and work on homework problems in groups. However, each student must write down the solution independently, and without referring to written notes from the joint session. Students submitting in a pair act as one unit - they may share resources (such as notes) with each other and write the solutions together. Note that both of the two students should fully understand all the answers in their submission, even though only one of them needs to write up a solution to a question. In other words, each student must understand the solution well enough in order to reconstruct it by him/herself. In addition, each student should write on the problem set the set of people with whom s/he collaborated.
      Further, since we occasionally reuse problem set questions from previous years, we expect students not to copy, refer to, or look at the solutions in preparing their answers. It is an honor code violation to intentionally refer to a previous year's solutions. This applies both to the official solutions and to solutions that you or someone else may have written up in a previous year.

    17. Lecture Video Policy
    18. All lectures this quarter will be recorded on Zoom. For your convenience, you can access these recordings by logging into the course Canvas site. These recordings might be reused in other Stanford courses, viewed by other Stanford students, faculty, or staff, or used for other education and research purposes. Note that while the cameras are positioned with the intention of recording only the instructor, occasionally a part of your image or voice might be incidentally captured. If you have questions, please contact a member of the teaching team.

      We highly encourage you to attend these zoom lectures as we hope to make them interactive and students can also ask their questions through the zoom chat function.
    19. Zoom Office Hours and Queue Status
    20. We will be using QueueStatus and Zoom to hold remote office hours this quarter. After putting your name in the queue (can be found here), please watch for messages from the TAs on QueueStatus. Each TA will have their own Zoom meeting, and will message you when it is your turn. If there are several people in the queue, we will ask that everyone who has the same question also join the Zoom meeting, so we can process people in parallel.
    21. Audit Request
    22. If you are a current Stanford student or a staff member, you may request to audit the course. Please fill out this form here, we will review all the audit requests on the 1st day of the classes and add you to the course’s Canvas page. Please note, Auditors do not get access to the Piazza and student Slack group. Also, please note, as an auditor, you cannot submit the assignments on Gradescope and you will not be graded.
    23. Incomplete Requests from Previous Quarter
    24. If you have an Incomplete from previous quarter and you wish to complete the course this quarter, please note, that since this time, we are making the final project optional, you are not required to submit a project. In that case, we calculate your grade based on your performance in assignments and midterm. Contact one of the instructors/TAs to notify us that you would like to complete CS229 this quarter.

    Teaching Assistants