Computer Science 189 — Introduction to Machine Learning (4 Units)

Course Overview


The purpose of CS 189 is to provide an introduction to machine learning. Machine learning is chiefly concerned with understanding structures within data and applying these structures to solve problems that can involve predictions and clustering, among other statistical applications. In this course, the recurring example problems are making an email spam filter and a handwritten-digit recognizer. The course aims to provide theoretical foundations, algorithms, methodologies, and applications for machine learning, though it is more akin to a "bag of tools" class rather than one that focuses heavily on mathematical foundations (CS281A provides that). Topics may include supervised methods for regression and classification (linear models, decision trees, neural networks, ensemble methods, instance-based methods); generative and discriminative probabilistic models; Bayesian parametric learning; density estimation and clustering; Bayesian networks; time series models; dimensionality reduction; programming projects covering a variety of real-world applications.



  • Math 53 (or another vector calculus course),
  • Math 54, EECS 16A + 16B, or Math 110 (or another linear algebra course),
  • CS 70 or EECS 126 (or other courses covering discrete math and probability)


  • Data 100!
  • CS 188 (artificial intelligence)

You should take the first three prerequisites quite seriously: if you don't have them, it is strongly recommended not to take CS 189. CS 188 is not quite as essential, but still a very good idea.

Topics Covered

  • Math Background:
    • Maximum likelihood estimation
    • Decision theory
    • Multivariate Gaussians
    • Optimization
    • Matrix Calculus
  • Supervised Learning:
    • Linear regression
    • Logistic regression
    • Ridge regression
    • Lasso regression
    • Kernel methods
    • SVMs
    • Nearest neighbor methods
    • Decision trees
    • Ensemble methods
    • Neural networks
  • Unsupervised Learning:
    • Clustering
    • Dimensionality reduction


Course Work

The homeworks are drastically different depending on the instructor you have. Historically this course has featured roughly eight programming assignments and a couple of theory problem sets. Programming assignments can be done in any language of your choice (though MATLAB or NumPy are strongly recommended). Programming assignments are somewhat lengthy (each will take longer than any CS 188 project, for instance). This class is heavy on math, especially linear algebra (Math 54), multivariable calculus (Math 53), and probability (CS 70, EE 126) One midterm and one final

Time Commitment

  • 3 hours of lecture per week
  • 1 hour of discussion per week
  • 5-15 hours per written HW
  • 10-30 hours per coding HW

Although there is variation across semesters and students, expect to spend around 10 hours outside of class per week on this class. Relative to CS 188, it will be significantly more work.

Choosing the Course

When to take

Most people take this class in their junior or senior year after taking CS 188. This class expands a lot on the machine learning concepts introduced in CS 188. In addition, you should be confident in doing linear algebra and probability from Math 54 and CS 70 since this class is extremely math heavy.

What's next?

  • EE 127 for more depth on the theory behind the optimization component of machine learning. Also EE 227B is a good followup after EE 127.
  • Grad level classes that apply machine learning to specific areas (such as robotics, NLP, etc.)

Usefulness for Research or Internships

The machine learning methods taught are directly applicable to both research and industry. That said, it may be hard to find an internship/entry level job directly applying machine learning, as many employees in the field have higher degrees.

This class is very useful for getting research. There are plenty of opportunities to get research in machine learning algorithms or research that uses machine learning.

Additional Comments/Tips

  • This class is considered a more mature class than CS 188, and as such there will be far less support available; you’ll be expected to stand on your own more.
  • This class is cross-listed as the grad level course CS 289A, so there will be grad students taking the class too (although their midterm scores will not affect the undergrad curve, and vice versa). The grad level has an additional final project component as well, which undergrads are not required to complete.
  • The coding HWs are basically the projects of this class. They can take a significant time to do since you often have to run your machine learning algorithms which may take a long time depending on your system. Start early to make sure you do not run out of time. Stay on top of the material. This course goes by extremely fast.
  • This class allows you to code using Python with Numpy or Matlab. Make sure you are comfortable with either before taking this course.

Last edited: Summer 2020