Machine learning (ML) is a set of techniques that allow computers to learn from data and experience rather than requiring humans to specify the desired behaviour by hand. ML has become increasingly central both in AI as an academic field and industry. This course provides a broad introduction to some of the most commonly used ML algorithms. It also introduces vital algorithmic principles that will serve as a foundation for more advanced courses, such as CSC412/2506 (Probabilistic Learning and Reasoning) and CSC413/2516 (Neural Networks and Deep Learning).
We start with nearest neighbours, the canonical non-parametric model. We then turn to parametric models: linear regression, logistic regression, soft max regression, and neural networks. We then move on to unsupervised learning, focusing in particular on probabilistic models, but also principal components analysis and K-means. Finally, we cover the basics of reinforcement learning. We will develop a mathematical foundation to understand and implement these algorithms.
There are two sections of this course being offered this term. As of January 2023, we plan to have in-person lectures, tutorials, office hours, midterm and final exam. This may, given the COVID-19 situation, be subject to change by the university.
Please attend your assigned lecture and tutorial section. Auditing is not allowed this term without express written permission by the instructor.
Section | Instructor | Lecture | Tutorial |
---|---|---|---|
0101 | Michael Zhang | M 11:00 - 13:00, BA1190 | W 11:00 - 12:00, BA1190 |
0102 | Chandra Gummaluru | M 14:00 - 16:00, BA1160 | W 14:00 - 15:00, BA1160 |
Although the pandemic has diminished somewhat, all indications are that we are not yet out of the woods. The university no longer requires the use of masks on its premises but encourages it where it is impossible to maintain physical distancing, such as in classrooms and offices.
We strongly recommend that you continue to wear masks during lectures, tutorials, and office hours out of consideration for the health of others. We also encourage you to get vaccine booster shots whenever possible. The instructors plan to wear masks when in close proximity with students, such as when answering questions after lectures or during office hours. However, we may take off our masks when lecturing if we are at a safe distance from students.
This course has the following pre-requisites:
Programming Basics: CSC207/ APS105/ APS106/ ESC180/ CSC180
Multi-Variable Calculus: MAT235/ MAT237/ MAT257 / (77%+ in MAT135, MAT136)/ (77%+ in MAT137)/ (67%+ in MAT157)/ MAT291/ MAT294 / (77%+ in MAT186, MAT187)/ (73%+ in MAT194, MAT195) / (73%+ in ESC194, ESC195)
Programming Basics: CSC207/ APS105/ APS106/ ESC180/ CSC180
Linear Algebra: MAT221/ MAT223/ MAT240/ MAT185/ MAT188
Probability: STA237/ STA247/ STA255/ STA257/ STA286/ CHE223/ CME263/ MIE231/ MIE236/ MSE238/ ECE286
We will use the following grading scheme for the course.
Evaluation | Weight |
---|---|
Math Diagnostic Quiz | 2% |
Assignments (3) | 33% |
Project | 10% |
Midterm Exam | 20% |
Ethics Module | 5% |
Final Exam | 30% |
Note that you must obtain a grade of at least 40% on the final exam to pass the course. For the Ethics Module, the 5% weight will be split into mini-assignments, as follows:
Mini-Evaluation | Weight | Marking |
---|---|---|
Pre-Module Survey | 1% | Completion |
Class Participation | 0.5% | Automatically Given |
Reflection on Class Activity | 2% | Good-Faith Effort |
Post-Module Survey | 1.5% | Completion |
In short, we expect almost all students to get the full 5%. |
There are many ways to get in touch with us.
Please follow these rules when you contact us:
TAs will hold office hours to help with assignments and project, as well as preparing for the midterm and the final exam. TA office hours will be posted in the respective sections.
There will be 3 assignments in this course, posted below. Assignments will be due at 5pm on Tuesdays or Fridays and submitted through Crowdmark.
# | Materials | TA Office Hours |
Assignment 1 |
[hw1.pdf] [clean_fake.txt] [clean_real.txt] [clean_script.py] |
Wednesday January 25, 2023, 1:00PM-2:00PM, (virtual). Wednesday, January 25, 2023, 4:00PM-6:00PM (virtual). Wednesday January 25, 2023, 5:00PM-6:00PM (virtual). Thursday, January 26, 2023, 9:00AM-11:00AM (in person in BA2270, CS Help Centre). Thursday, January 26, 2023, 5:00PM-6:00PM (in person in BA2270, CS Help Centre). Thursday, January 26, 2023, 6:00PM-8:00PM (in person in BA2270, CS Help Centre). Friday, January 27, 2023, 11:30AM-12:30PM (in person in BA2270, CS Help Centre). Friday, January 27, 2023, 1:00PM-2:00PM (virtual). Friday, January 27, 2023, 4:00PM-6:00PM (in person in BA2270, CS Help Centre). Friday, January 27, 2023, 5:00PM-6:00PM (virtual). Monday, January 30, 2023, 5:00PM-6:00PM (virtual). |
Assignment 2 |
[hw2.pdf] [hw2_code.zip] |
Thursday Feb 9, 8-10 AM (online) Friday Feb 10, 4-5PM, Pratt 286 Tuesday Feb 14, 10-11 AM, Pratt 286 Wednesday Feb 15, 12:30 - 1:30PM Pratt 286 Wednesday Feb 15, 5-7PM (online) Friday Feb 17 10-11AM (online) |
Assignment 3 |
[hw3.pdf] [hw3_code.zip] |
Friday, March 17, 2023, 5:00PM-6:00PM (BA2270, CS Help Centre). Friday, March 24, 2023, 10:00AM-11:00AM (virtual). Monday, March 27, 2023, 9:00AM-11:00AM (virtual). Tuesday, March 28, 2023, 10:00AM-11:00AM (PT 286). Wednesday, March 29, 2023, 9:00AM-11:00AM (virtual). Thursday, March 30, 2023, 9:00AM-11:00AM (BA2270, CS Help Centre). Monday, April 3, 2023, 12:00PM-1:00PM (virtual). Tuesday, April 4, 2023, 10:00AM-11:00AM (PT 286). |
Computational Resources: We will use Python 3, and libraries such as NumPy, SciPy, and scikit-learn. You have two options:
The easiest option is probably to install everything yourself on your own machine.
If you don't already have Python 3, install it.
We recommend some version of Anaconda (Miniconda, a nice lightweight conda, is probably your best bet). You can also install Python directly if you know how.
Optionally, create a virtual environment for this class and step into it. If you have a conda distribution run the following commands:
conda create --name csc311
source activate csc311
Use pip
to install the required packages
pip install scipy numpy autograd matplotlib jupyter scikit-learn
All the required packages are already installed on the Teaching Labs machines.
Late Submission Policy: Everyone will receive 3 grace days, which can be used at any point during the semester on the three assignments. No credit will be given for assignments submitted after 3 days. We will have a separate policy on the final project.
Collaboration Policy: Collaboration on assignments is not allowed. Each student is responsible for his/her own work. Discussion of assignments should be limited to clarification of the handout itself, and should not involve any sharing of pseudocode or code or simulation results. Violation of this policy is grounds for a semester grade of F, in accordance with university regulations.
Remark Policy: If you discover a marking error on an assignment, you can submit a remark request. We will consider remark requests up to two weeks after we release the marks for an assignment or the midterm. Please submit your remark request via Crowdmark.
About half-way through the term, we will have a midterm examination. You will be allowed to bring an aid-sheet (one-side 8.5" by 11"). The midterm will be held during the lecture slot on Feb 13. More details will be posted as we get closer to the midterm.
At the end of the term, we will have a FAS proctored final examination. You will be allowed to bring an aid-sheet (two-sides 8.5" by 11"). More details will be posted as we get closer to the final exam.
For your final project, one option is to solve a matrix completion problem. The goal is to predict, in the context of a personalized education platform, whether a student will correctly answer a diagnostic question. In groups of 2-3, you will implement and evaluate several algorithms from the course, and then propose and evaluate an extension to one of these algorithms. The other option is open-ended and both are described in the handout below.
[project.pdf]
[starter_code.zip]
You can find all of the relevant lecture/tutorial materials below. The suggested readings are optional. We have provided them in case you need alternate resources to understand the material. All of the textbooks listed below are freely available online.
Most of the lecture recordings are available on a Youtube playlist.Week | Topics Covered | Materials | Suggested Readings |
---|---|---|---|
1 | Lecture: Introduction / Nearest Neighbours Tutorial: Probability Review |
Lecture: Slides Michael annotated Tutorial: Slides |
Math for ML (skim) ESL: 1, 2.1-2.3, 2.5 |
2 | Lecture: Decision Trees, Bias-Variance Decomposition Tutorial: Linear Algebra Review |
Lecture: Slides Michael annotated Tutorial: Slides Colab Notebook |
Bishop: 3.2 ESL: 2.9, 9.2 Course notes: Notes on Generalization, Bias-Variance Decomposition |
3 | Lecture: Linear Models 1 (Linear Regression) Tutorial: Bias-Variance Decomposition |
Lecture: Slides Michael annotated Tutorial: Slides |
Bishop: 3.1 ESL: 3.1 - 3.2 Course notes: Linear Regression, Calculus |
4 | Lecture: Linear Models 2 (Logistic Regression) Tutorial: Optimization |
Lecture: Slides Michael annotated Tutorial: Slides |
Bishop: 4.1, 4.3 ESL: 4.1-4.2, 4.4, 11 Why momentum really works Course notes: Linear Classifiers, Training a Classifier |
5 | Lecture: Linear Models 3 / Review Tutorial: Midterm Review |
Lecture: Slides Michael annotated Linear Regression Colab Tutorial: Slides |
Bishop: 5.1-5.3 Course notes: Multilayer Perceptrons |
6 | Midterm (2/13) | ||
7 | Lecture: Neural Networks Tutorial: Pytorch |
Lecture: (continued from before) Michael annotated Tutorial: Colab |
Neural Net Playground |
8 | Lecture: Neural Networks 2 Lecture 2: Probabilistic Models |
Lecture: Slides NNs annotated Probabilistic Models annotated Lecture 2: Slides |
Backpropagation Convolutional neural networks ESL: 2.6.3, 6.6.3, 4.3.0 MacKay: 21, 23, 24 Probabilistic models |
9 | Lecture: Multivariate Gaussians, GDA Tutorial: Linear Algebra Review Part 2 |
Lecture: Slides Michael Annotated Tutorial: Slides Solutions |
Math for ML Bishop: 12.1 |
10 | Lecture: PCA, Matrix Completion Tutorial: PCA |
Lecture: Slides Michael Annotated Tutorial: Problems |
ESL: 14.5.1 |
11 | Lecture: Ethics unit (3/27) Tutorial: |
Lecture: Part 1 Part 2 Tutorial: Slides |
Understanding Recommendation Algorithms Beyond engagement |
12 | Lecture: K-means, RL Tutorial: Final Review |
Lecture: K-means Lecture: RL K-means annotated RL annotated Tutorial: Slides |
MacKay: 20 Bishop: 9 Barber: 20.1-20.3 See slides for RL recs. |
Academic integrity is essential to the pursuit of learning and scholarship in a university, and to ensuring that a degree from the University of Toronto is a strong signal of each student’s individual academic achievement. As a result, the University treats cases of cheating and plagiarism very seriously. The University of Toronto’s Code of Behaviour on Academic Matters outlines the behaviours that constitute academic dishonesty and the processes for addressing academic offences.
All suspected cases of academic dishonesty will be investigated following procedures outlined in the Code of Behaviour on Academic Matters. If students have questions or concerns about what constitutes appropriate academic behaviour or appropriate research and citation methods, they are expected to seek out additional information on academic integrity from their instructors or from other institutional resources.
If you are unable to complete a course requirement due to extraordinary circumstances beyond your control, please apply for a Special Consideration by filling out this special considerations form and sending it to the course email with your supporting documentation. A special consideration request, particularly if it is not your first request in the course, would not be granted automatically.
Legitimate reasons to apply for a special consideration request:
A heavy course load, multiple assignments/tests scheduling during the same period, and time management issues are not appropriate reasons to grant special considerations. Such accommodations are meant for exceptional circumstances only and not as a means to catch up on term work. If you are having difficulty with stress and time management, please contact your college registrars, who can in turn suggest wellness counselling, academic advising, and/or learning strategists services.
Our special considerations policies are as follows.