Foundations of Machine Learning
The conceptual grounding: what machine learning is, how it differs from traditional programming, the data it works with, and the Python ecosystem you will use throughout the course.
Start here
Everything you need to know before your first tutorial. What the course covers, how it is organised, what you will be expected to do each week, and how to get help when something does not work. Read this once carefully and you will not need to come back to it — but it will answer most of the questions you would otherwise ask.
Machine learning is no longer a specialist topic. It is the mechanism behind recommendation systems, medical screening tools, fraud detection, language models and an increasing share of the decisions that organisations make about people. COMP328 is designed to give you a working, critical understanding of how those systems are built — and of where they fail.
This is a foundations course. It does not assume you have built a model before. It does assume you are comfortable writing code, that you have seen some statistics, and that you are willing to engage with the mathematics rather than skip past it. The mathematics is not decoration — it is what separates a practitioner who can use a library from one who can tell when the library is producing nonsense.
By the end of the course you will have fitted regression models, trained classifiers, built neural networks, evaluated all of them honestly, and written up a complete machine learning project with a proper account of its limitations. You will also have spent time on the parts of the field that are hardest and most consequential: bias, fairness, leakage, and the decision of whether a model should be deployed at all.
Read it once, end to end, before your first tutorial. It is organised so that you can dip back into individual sections later — the sidebar of every other page in the course links back here if you need it. The FAQ at the bottom answers the questions that come up most often in the first two weeks.
The course has three strands that run in parallel: the conceptual understanding of how learning algorithms work, the practical skills to build and evaluate them, and the professional judgement to know when a model is appropriate. All three are assessed.
The course is divided into six modules, each containing two to four units. Every unit has its own landing page, and every unit contains a set of tutorials — self-contained learning pages that build up one topic at a time. The units are designed to be worked through in order, but the tutorials within a unit assume only the material that precedes them.
The conceptual grounding: what machine learning is, how it differs from traditional programming, the data it works with, and the Python ecosystem you will use throughout the course.
The core of the course. Linear regression, logistic regression, and the discipline of evaluating a model honestly — including the accuracy trap and data leakage.
The algorithms that defined the field before deep learning: decision trees, random forests, and support vector machines. Still the right tool for many problems.
Learning without labels: clustering, dimensionality reduction, association rules, and anomaly detection — the tools you reach for when you do not know what you are looking for.
How modern AI actually works. From the artificial neuron to convolutional networks, including the optimisation and regularisation techniques that make deep learning trainable.
What happens after the notebook works. Deployment, monitoring, bias, fairness, transparency, and the emerging regulatory landscape that governs all of it.
Every page in the course has the same navigation bar at the top and the same breadcrumb trail beneath it. Tutorial pages have a sidebar on the left listing the sections within that page and the other tutorials in the same unit. If you get lost, the breadcrumb at the top of the page tells you exactly where you are.
Machine learning is learned by doing. Reading about regression does not teach you to fit a regression model any more than reading about swimming teaches you to swim. The students who do well in COMP328 are the ones who run the code, break it deliberately, and write down what they observe. The ones who struggle are usually the ones who read the tutorials carefully and never open a notebook.
Reading the tutorials and assuming you understand them, without ever opening a notebook. Understanding on the page and understanding at the keyboard are different things, and only the second one is assessed. If you take one thing from this page, take this: the notebook is not supplementary.
COMP328 is designed for second- and third-year undergraduate Computing students, and for technical professionals making the transition into machine learning. It assumes the following background. If any of it is rusty, the first module includes refresher material — but it is worth knowing what you are refreshing.
| Area | What you need to be able to do | Equivalent to |
|---|---|---|
| Programming | Write and debug short programs. Understand variables, loops, functions, lists, dictionaries, and importing a library. | COMP 200 Programming Fundamentals |
| Python | Use Python specifically, including basic file I/O and working in a REPL or notebook. | Any introductory Python course |
| Statistics | Compute and interpret a mean, variance and correlation. Understand what a distribution is and what a scatter plot shows. | COMP 268 Introduction to Statistics |
| Algebra | Rearrange equations. Read and write summation notation. Understand what a derivative represents, even if you cannot compute one fluently. | Secondary-school mathematics |
Not everyone arrives with the same preparation, and the course is designed so that gaps can be filled. The first tutorial of Unit 4 includes a calculus refresher box covering everything you need for gradient descent. Unit 3 of Module 1 is a Python and scikit-learn primer. If you find yourself stuck on notation, the discussion forum is the fastest place to ask — there is no penalty for asking a basic question.
Everything in this course can be done with free, open-source software. You do not need to buy anything, and you do not need access to a GPU. A laptop from the last five years will handle every exercise in Modules 1 to 6.
The simplest route is a self-contained distribution that installs everything at once. If you are already comfortable managing Python environments, install the packages directly.
# Option 1 — conda (recommended for beginners)
conda create -n comp328 python=3.11 numpy pandas matplotlib scikit-learn jupyter
conda activate comp328
# Option 2 — pip into a virtual environment
python -m venv comp328
source comp328/bin/activate # macOS / Linux
comp328\Scripts\activate # Windows
pip install numpy pandas matplotlib scikit-learn jupyter
Verify the installation by running this in a notebook or Python shell:
import numpy, pandas, matplotlib, sklearn
print("numpy ", numpy.__version__)
print("pandas ", pandas.__version__)
print("matplotlib ", matplotlib.__version__)
print("scikit-learn", sklearn.__version__)
numpy 1.26.4
pandas 2.2.1
matplotlib 3.8.3
scikit-learn 1.4.1
Version numbers do not need to match exactly. Any reasonably recent release will run every notebook in the course. If you are using Google Colab, everything is already installed.
Create a single dedicated environment for this course and install everything into it. Mixing packages across a system-wide Python installation is the single most common cause of "it works on my machine" problems, and it is entirely avoidable.
Assessment is continuous, cumulative, and heavily weighted toward applied work. The quizzes check that you have understood the concepts; the assignments check that you can use them; the capstone checks that you can put the whole thing together.
Twenty short auto-marked quizzes, one per unit. Unlimited attempts until the deadline. Formative in spirit, but the grades count.
Five applied assignments, one per module from Module 2 onwards. Each requires running the full workflow on a dataset of your choice and writing it up.
A complete machine learning lifecycle project: problem selection, data acquisition, modelling, evaluation, ethics analysis, and a final report.
A written examination covering the whole course, with an emphasis on conceptual reasoning, interpretation, and diagnosis rather than computation.
Every assignment is marked on the quality of the decisions you make and the honesty of your reporting, not on the performance of the model. A well-documented model with a validation R² of 0.6 and a clear account of its limitations will score higher than an undocumented model with R² of 0.9 and no residual analysis. This is deliberate — it reflects how machine learning is actually practised.
Machine learning involves a lot of small, frustrating problems — an import that fails,
a plot that comes out blank, a model that returns NaN without explanation.
None of these are reasons to struggle alone. There are several routes to help, and
using them is expected rather than a sign of weakness.
The primary route for questions about the material, the tutorials and the exercises. Search before posting — the question you have is often already answered. The forum is monitored daily on weekdays.
Weekly drop-in sessions for anything that is easier to discuss in person. Times are posted on the syllabus page. No appointment needed — just turn up.
Two weeks before each assignment deadline, an extended clinic is held specifically for assignment questions. Bring your notebook and your specific problem.
Students are encouraged to form small study groups. Working through a difficult concept with someone else is often faster than working through it alone. Post in the forum if you would like to find one.
Include four things: what you were trying to do, what you expected to happen, what actually happened (including the full error message if there is one), and what you have already tried. Questions phrased this way get answered in minutes. Questions phrased as "my code does not work" take much longer.
If your question involves code, paste the smallest snippet that reproduces the problem — not the whole notebook.
This course is designed to be usable by everyone. The materials are built to meet WCAG 2.1 AA standards, and every attempt has been made to ensure that the content does not create barriers for students with disabilities, students studying in a second language, or students working with limited access to technology.
If you require a specific adjustment — additional time on assessments, an alternative format for materials, or anything else — contact the course team early. Adjustments are almost always straightforward to arrange, but they are much easier to arrange before a deadline than after it.
Machine learning is a field where collaboration is normal and expected in professional practice, and this course is designed to reflect that. You are encouraged to discuss concepts, compare approaches and help one another understand the material. What you may not do is submit work you did not produce.
| Activity | Allowed? | Notes |
|---|---|---|
| Discussing concepts with classmates | Yes | Encouraged. Explaining an idea to someone else is one of the best ways to check your own understanding. |
| Comparing model approaches and results | Yes | In general discussion, not in written submissions. Your submission must be your own work. |
| Sharing code snippets for debugging | With care | Fine for troubleshooting a specific error. Not fine as a substitute for writing your own solution. |
| Submitting someone else's notebook as your own | No | This is plagiarism, regardless of whether the source is a classmate, a website or an AI tool. |
| Using an AI assistant to help you understand a concept | Yes | Treat it like a textbook or a tutor. Ask it to explain, not to produce your submission. |
| Using an AI assistant to generate your submission | No | The written analysis and the modelling decisions must be your own. Code that you did not write must be cited. |
| Citing a dataset, code fragment or figure you did not produce | Required | Every external resource must be cited, including the source of any data you use. |
If a tool produced a substantial part of your submission, and you could not reproduce that part yourself without the tool, then you have not demonstrated the learning the assignment is assessing. The point of the assessment is to check that you can do the work — not that the work can be done.
The questions that come up most often in the first two weeks of the course. If yours is not here, post it in the discussion forum.
You need to understand what a derivative represents — the slope of a function at a point — and you need to be comfortable with the idea that setting a derivative to zero finds a minimum. You do not need to be able to differentiate complex expressions fluently.
Every derivation in the course is worked through step by step, and the calculus refresher in Unit 4 covers everything you need for gradient descent. If you can read the notation and follow the reasoning, you will be fine.
No. Every exercise in the course, including the neural network material in Module 5, runs on a standard laptop CPU in a reasonable amount of time. The datasets are small by the standards of modern deep learning, and the models are deliberately modest. If you want to experiment with larger models, Google Colab offers free GPU access, but it is not required.
Python, throughout. Every tutorial, notebook and example in the course is written in Python. R and Julia are both excellent for machine learning, but this course is not taught in them, and the assessment assumes Python.
A typical week involves around four to five hours of guided study — reading the tutorials and working through the notebooks — plus two to three hours on the current assignment. In weeks leading up to assignment deadlines, expect to spend more.
The work is cumulative. Falling behind by a week is recoverable. Falling behind by three weeks usually is not, because each unit assumes the previous one. If you find yourself behind, contact the course team early rather than trying to catch up silently.
Choose something you find interesting, that has a genuine regression or
classification target, and that is small enough to work with comfortably — a few
thousand rows rather than a few million. Public repositories such as the UCI
Machine Learning Repository, Kaggle and sklearn.datasets are all
good starting points.
What matters is not the dataset's prestige but whether it lets you demonstrate the full workflow. A small, messy, real dataset with a clear target will always score better than a large, clean one where you skip the cleaning and framing stages.
Yes, if you have permission to use it and if it can be anonymised for submission. Using a real dataset from your own context often produces stronger work, because you understand what the features mean and what the costs of error actually are. Check with your employer first, and remove or aggregate any identifying information before submitting.
Nothing — provided you can explain why. Assignments are marked on the quality of your analysis, not on the performance of your model. A model with a validation R² of 0.5 and a clear explanation of its limitations will score higher than a model with R² of 0.9 and no diagnostic analysis. A model that fails in an interesting, well-documented way is often more valuable than one that succeeds quietly.
Yes, but generously. Each quiz has a time limit that is roughly triple what a well-prepared student would need. The limit exists to discourage looking up every answer, not to create time pressure. You have unlimited attempts until the deadline, so a low score on a first attempt is not a problem.
The capstone is a complete machine learning project that you design yourself. You choose the problem, acquire and prepare the data, build and evaluate a model, analyse the ethical implications, and present your findings in a written report and a short presentation. It is the largest single piece of assessment in the course, and it is designed to be the thing you show a prospective employer. Full details are on the capstone page.
Yes, with effort. The course assumes you can write short programs, but it does not assume you have built a large project or worked with real data before. Module 1 includes a Python and scikit-learn primer specifically designed for students in your position.
The most common difficulty is not the code itself but the debugging. Learning to read an error message, isolate the problem, and search for a solution is a skill in its own right. It develops with practice, and the discussion forum is there for exactly this reason.
Absolutely. All materials are available from the start of the course, and there is no penalty for finishing early. The only constraint is assessment deadlines, which are fixed. Working ahead is one of the most reliable predictors of doing well, because it means you encounter problems while you still have time to resolve them.
Module 1 starts with the question every machine learning project begins with: what is machine learning, and what is it not? It takes about an hour, and it sets up everything that follows.