COMP328 Fundamentals of Machine Learning

Start here

Welcome to COMP328 Orientation

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.

6 modules 20 units 170+ learning pages 1 capstone project

Welcome to COMP328

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.

How to use this page

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.

What you will learn

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.

Knowledge

  • Explain the principles behind supervised, unsupervised and reinforcement learning, and identify which paradigm a given problem requires.
  • Describe the major machine learning algorithms — linear and logistic regression, decision trees, ensembles, support vector machines, clustering, PCA, and neural networks — and the assumptions each one makes.
  • State what a loss function is, why convexity matters, and how gradient descent finds a minimum.
  • Explain the bias–variance tradeoff and use it to reason about underfitting, overfitting and model selection.

Skills

  • Prepare a dataset for modelling: handle missing values, encode categorical variables, scale features, and audit for leakage.
  • Train predictive models using scikit-learn, and implement key algorithms from scratch in NumPy where that deepens understanding.
  • Evaluate models honestly using appropriate metrics, held-out data, cross-validation, and diagnostic plots.
  • Interpret model outputs and coefficients, and communicate findings to both technical and non-technical audiences.
  • Build an end-to-end machine learning pipeline that generalises beyond the training data.

Professional competencies

  • Identify bias, proxy variables and fairness concerns in a modelling pipeline, and reason about the trade-offs involved in addressing them.
  • Assess the ethical implications of a predictive model and its deployment context.
  • Write a model card and a reporting document that a sceptical reviewer would accept.
  • Decide whether a model should be deployed, with justification, rather than only whether it can be.
  • Communicate uncertainty honestly, including the limitations and the range of validity of a model.

How the course is organised

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.

How to navigate

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.

How to succeed in this course

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.

  1. Read the concept, do not skim it Sections 1–5 of each tutorial carry the idea. Slow down on the worked example and work through the arithmetic on paper.
  2. Run every notebook yourself Type the code out at least once before you copy-paste it. Change a number. Break the model on purpose. The failures teach you more than the successes.
  3. Do the self-check before revealing the answer Section 7 of every tutorial exists to catch a misunderstanding while it is still cheap to fix. If you cannot answer a question, re-read the relevant section.
  4. Complete the practice exercises and problem set Sections 8 and 9 are where the skill actually forms. They are not optional, even though they are not directly graded.
  5. Contribute to the discussion prompts Section 10 asks you to reason about the model, not just run it. Writing two sentences that defend a choice will consolidate more than an hour of re-reading.
  6. Start assignments early and use the full workflow The eight-stage workflow from Unit 4 is the template for every assignment. Framing, auditing and splitting before modelling is not optional.
  7. Ask for help when you are stuck for more than an hour Being stuck is normal. Being stuck for a whole afternoon is not a badge of honour. Post in the discussion forum or come to office hours.

The single most common mistake

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.

What you are assumed to know

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.

Assumed prior knowledge
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

If something is missing

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.

Tools you will use

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.

Python 3.10 or later The language the entire course is taught in. Any recent version will work; 3.10 or above is recommended for the newer type-hint syntax used in some examples.
Jupyter Notebook or JupyterLab Every tutorial has an accompanying notebook. You can run them locally or in a browser environment such as Google Colab or Binder.
NumPy Array arithmetic and linear algebra. You will use it directly when implementing algorithms from scratch, and indirectly whenever you use scikit-learn.
pandas Data manipulation. Loading CSV files, inspecting dataframes, handling missing values, and grouping data for subgroup analysis.
Matplotlib Plotting. Residual plots, learning curves, and every diagnostic figure in the course.
scikit-learn The main modelling library. Pipelines, preprocessing, cross-validation, and the implementations of every algorithm in Modules 2 to 4.

Setting up your environment

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.

One environment, not many

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.

How you will be assessed

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.

5%

Module quizzes

Twenty short auto-marked quizzes, one per unit. Unlimited attempts until the deadline. Formative in spirit, but the grades count.

40%

Assignments

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.

25%

Capstone project

A complete machine learning lifecycle project: problem selection, data acquisition, modelling, evaluation, ethics analysis, and a final report.

30%

Final exam

A written examination covering the whole course, with an emphasis on conceptual reasoning, interpretation, and diagnosis rather than computation.

The five assignments

  • Assignment 1 Data Exploration — clean, audit and describe a dataset View brief →
  • Assignment 2 Regression Modelling — fit, evaluate and report a regression model View brief →
  • Assignment 3 Classification Analysis — build and evaluate a binary classifier View brief →
  • Assignment 4 Unsupervised Learning — cluster and reduce a dataset without labels View brief →
  • Assignment 5 Neural Network Modelling — train and evaluate a neural network View brief →

Assignment philosophy

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.

Getting help

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.

Discussion forum

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.

Office hours

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.

Assignment clinics

Two weeks before each assignment deadline, an extended clinic is held specifically for assignment questions. Bring your notebook and your specific problem.

Peer study groups

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.

How to ask a good question

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.

Accessibility and inclusion

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.

What we have done

  • All pages are keyboard navigable and work with screen readers.
  • Colour is never the only way information is conveyed — figures use labels and patterns as well.
  • Every diagram has an equivalent text description in its caption.
  • Notebooks are designed to run on modest hardware and do not require a GPU.
  • Code blocks are scrollable rather than truncated on small screens.
  • The materials are available in multiple formats for offline study.

What we ask of you

  • If you encounter a barrier, report it. Feedback goes directly to the course team.
  • Contribute to a discussion culture where basic questions are welcome.
  • Be mindful that your peers arrive with different backgrounds and different amounts of prior exposure to Computing
  • Use the accessibility statement to request specific adjustments if you need them.

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.

Academic integrity and the use of AI tools

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.

What is and is not allowed
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.

The test to apply

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.

Frequently asked questions

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.

Do I need to know calculus?

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.

Do I need a GPU?

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.

Which programming language should I use?

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.

How much time should I expect to spend each week?

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.

How do I choose a dataset for my assignment?

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.

Can I use a dataset from my job?

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.

What happens if my model performs badly?

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.

Are the quizzes timed?

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.

What is the capstone, exactly?

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.

I have never written code outside of a classroom. Will I cope?

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.

Can I work ahead?

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.

Ready to begin?

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.

👤