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.
This course will delve deep into the mathematical foundations of machine learning and will focus on implementing, understanding and debugging software programs for building machine learning models from data. This class will make heavy use of the mathematical and statistical pre-requisites for this class. Students are expected to be comfortable with technical material from multivariate probability theory, multivariable calculus and linear algebtra enough to manipulate them towards the description, design and implementation of learning algorithms for machine learning models.
There are two sections of this course being offered this term. We intend to have in-person lectures, tutorials, office hours, midterm and final exam.
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 | Rahul G. Krishnan | Wed 11:00 - 11:00, EM001 | Fri 11:00 - 12:00, EM001 |
0201 | Amanjit Singh Kainth | Tue 15:00 - 17:00, AH100 | Thu 15:00 - 16:00, KP108 |
The pandemic has diminished and the university no longer requires the use of masks on its premises. However, we encourage the use of masks where it is impossible to maintain physical distancing, such as in classrooms and offices, or when you feel that doing so is in the interest of your health.
We strongly recommend that you continue to wear masks during lectures, tutorials, and office hours out of consideration for the health of others if you feel under the weather. We also encourage you to get vaccine booster shots whenever possible. The instructors may 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.
There are several generative AI tools such as ChatGPT, GPT4, Bard, Claude available for public use as general purpose chatbots. These machine learning models are incredibly powerful and are capable of providing responses to arbitrarily complex text (and sometimes image) queries. You may use generative artificial intelligence (AI) tools, including ChatGPT and GitHub Copilot, as learning aids.
Generative AI is not required to complete any aspect of this course, and we caution you to not rely entirely on these tools to complete your coursework. Instead, we recommend treating generative AI as a supplementary tool only for exploration or drafting content. Ultimately, you (and not any AI tool) are responsible for your own learning in this course, and for all the work you submit for credit. It is your responsibility to critically evaluate the content generated, and to regularly assess your own learning independent of generative AI tools. Overreliance on generative AI may give you a false sense of how much you’ve actually learned, which will lead to poor performance on the midterm test and final exam, in later courses, or in future work or studies after graduation. You will not be permitted to use generative AI on the midterm test or final exam. Remember that you (and not any AI tool) are responsible for your own learning in this course, and for the final work you submit for this assignment. This assignments and homeworks are designed to be doable without the use of generative AI, using only concepts and skills we have covered in lecture and in the course readings.
While some generative AI tools are currently available for free in Canada, please be warned that these tools have not been vetted by the University of Toronto and might not meet University guidelines or requirements for privacy, intellectual property, security, accessibility, and records retention. Generative AI may produce content which is incorrect or misleading, or inconsistent with the expectations of this course. They may even provide citations to sources that don’t exist—and submitting work with false citations is an academic offense. These tools may be subject to service interruptions, software modifications, and pricing changes during the semester.
The final work you submit for assignments in this course must be your own, and may not include any verbatim content from generative artificial intelligence (AI) tools. You may, however, use generative AI to support your work on this assignment in the following ways:
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
Note that these are the minimum pre-requisites; in practice you are expected to have an operational knoweldge of the topics in the pre-requisites. CSC311 is a fast paced course. The preliminary quiz will help you self assess the degree to which your knowledge of the pre-requisites will be tested during the course of the semester. If you find yourself falling behind on the mathematical concepts, we strongly recommend investing time into self-study using the Mathematics for Machine Learning textbook.
We will use the following grading scheme for the course.
Evaluation | Weight |
---|---|
Assignments (3) | 30% |
Project | 10% |
Midterm Exam | 20% |
Ethics Module | 5% |
Final Exam | 35% |
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:
The top 5 students who assist on Piazza (ranking based on metrics collected by Piazza and manual review of responses by instructors) answering questions about the course material will each be awarded extra grades.
2% for the top two and 1% for the next three upto a cap of 100. Will be at instructors’ discretion based on quality and number of student created and endorsed responses.
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] |
[Phil] Sept 17, 2-4pm [online] [Phil] Sept 24, 2-4pm [online] [Sergey] Sept 16, 9am-11pm [online] [Sergey] Sept 23, 1-3 pm [online] |
Assignment 2 |
[hw2.pdf] [hw2_code.zip] |
[Lance] Oct 1, 12-2pm [in person] [Lance] Oct 8, 12-2pm [in person] [Mert] Sept 30, 9-11am [in person] [Mert] Oct 7, 9-11am [in person] |
Assignment 3 |
[hw3.pdf] [hw3_code.zip] |
[Ayoub] Oc 25, 11am-1pm [in person] [Ayoub] Nov 6, 12.30-2.30pm [in person] [Ethan] Oct 24, 1-3pm [online] [Ethan] Nov 7, 1-3pm [online] [Alireza] Nov 4, 3-5pm [online] [Alireza] Nov 5, 3-5pm [online] |
Final Project |
[project.pdf] [starter_code.zip] |
[Zeinab] Nov 18, 11am-12pm [online] [Asic] Nov 21, 9-10 am [online] [Asic] Nov 22, 9-10am [online] [Zeinab] Nov 22, 4 - 5 pm [online] [Asic] Nov 25, 6-7 pm [online] [Asic] Nov 27, 6-7 pm [online] [Zeinab] Nov 28, 10- 11 am [online] [Zeinab] Nov 28, 2- 3 pm [online] |
The goal for the proposal is to make sure that you are on the right track to define a project and have a clear plan on how to execute it. Think of it as something that ensures you have a clear idea of what success for your project looks like.
Your proposal should be a maximum of two (2) page summary of your intended direction (references excluded in the page limit).
You will be graded based on meeting the following criteria: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 one aid-sheet (double-sided 8.5" by 11"). The midterm will be held on October 15 and October 16. It will be conducted during lecture time. For both sections, please see below for where to go. For October 15, your midterm will be held in AH100. For October 16, your midterm will be held in EM001 and SU B120. Your location will be based on your last name. See Piazza for information. You are required to attend the midterm corresponding to the section you are registered in. .
We will have the following OH for the midterm, zoom information will be disbursed via Piazza:
10am–12pm with Mert (in person) @ BA7172
2pm–3pm with Asic (online, link to be shared on piazza)
4:30pm–5:30pm with Asic (in person) @ BA7172
At the end of the term, we will have a FAS proctored final examination. You will be allowed to bring an aid-sheet (two-sided 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.
Office hours
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.
Lecture recordings are available on Piazza.Week | Topics Covered | Mathematics Preparation Vides | Materials | Suggested Readings |
---|---|---|---|---|
1 S3, S4 | Lecture: Introduction / Nearest Neighbours Tutorial: Probability Review |
Supervised Learning Notation Probability Distributions |
Lecture: Slides Lecture: Annotated Slides Tutorial: Slides Colab Notebook (Probability) |
Math for ML (skim) ESL: 1, 2.1-2.3, 2.5 |
2 S10, S11 HW 1 out |
Lecture: Decision Trees, Bias-Variance Decomposition Tutorial: Linear Algebra Review |
Linear Algebra Expected Values Vector-Valued Functions |
Lecture: Slides Lecture: Annotated Slides Tutorial: Slides Colab Notebook (Decision Trees) |
Bishop: 3.2 ESL: 2.9, 9.2 Course notes: Notes on Generalization, Bias-Variance Decomposition |
3 S17, S18 | Lecture: Linear Models 1 (Linear Regression) Tutorial: Bias-Variance Decomposition |
Set Convexity Vectorization Partial Derivatives Gradients Contour Plots |
Lecture: Slides Lecture: Annotated Slides Tutorial: Slides |
Bishop: 3.1 ESL: 3.1 - 3.2 Math for ML Chapter 7 Matrix Cookbook, Calculus Course notes: Linear Regression, Calculus |
4 S24, S25 HW 1 due HW 2 out |
Lecture: Linear Models 2 (Logistic Regression) Tutorial: Optimization |
Vector Valued Functions Multivariate Chain Rule Set Convexity |
Lecture: Slides Lecture: Annotated Slides 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 O1, O2 | Lecture: Linear Models 3 / Neural Networks 1 Tutorial: Pytorch |
Representing Categorical Inputs Multivariate Chain Rule for Gradient Computation |
Lecture: Slides Lecture: Annotated Slides Tutorial: Slides Optimization Colab Pytorch Linear Models & Neural Networks |
Bishop: 5.1-5.3 Course notes: Multilayer Perceptrons |
6 O8, O9 HW 2 due, HW3 out |
Lecture: Neural Networks 2 Tutorial: Midterm Review |
Multivariate Chain Rule 1 Multivariate Chain Rule 2 |
Lecture: Slides Lecture: Annotated Slides Tutorial: Slides |
Autodidact
Neural Net Playground
Convolutional neural networks Backpropagation |
7 O15, O16 |
Midterm week | Midterm week |
ESL: 2.6.3, 6.6.3, 4.3.0 MacKay: 21, 23, 24 |
|
8 O22, O23 Project out |
Lecture: Probabilistic Models Tutorial: Maximum likelihood estimation --> |
Gaussian Maximum Likelihood Generative Modeling Terminology |
Lecture: Slides Lecture (Annotated) Annotated Slides Tutorial: Slides |
Math for ML Bishop: 12.1 Probabilistic models Coin Flip notebook |
9 N5, N6 HW 3 due |
Lecture: Multivariate Gaussians, GDA Tutorial: Linear Algebra Review II: Eigenvalues and SVD |
GDA Inferencea> |
Lecture: Slides Lecture: Annotated Slides Tutorial: Slides |
ESL: 14.5.1 |
10 N12, N13 | Lecture: Embedded Ethics Unit |
Lecture: Slides |
Beyond engagement
Understanding Recommendation Algorithms |
|
11 N19, N20 | Lecture: Principal Component Analysis, Matrix Completion Tutorial: EM |
Eigenvectors and Spectral Decomposition |
Lecture: Slides Lecture: Annotated Slides Tutorial: Slides |
MacKay: 20 Bishop: 9 Barber: 20.1-20.3 |
12 N26, N27 Project due end of week |
Lecture: Clustering via K-means Tutorial: Final Exam Review |
Lecture: Slides Lecture: Annotated Slides Tutorial: Slides |
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.