Mathematical Foundations for Machine Learning
Course Code: Y1B2
ECTS Credits: 4.0
Course Description
This course introduces students to the core mathematical principles that support modern machine learning. It covers key concepts in linear algebra, such as vectors, matrices, and linear transformations, and connects them to data representation and manipulation in machine learning. Students also learn essential calculus topics including derivatives, partial derivatives, and gradients, with practical applications in optimisation—particularly in understanding how the gradient descent algorithm is used to train machine learning models. The course integrates symbolic computation using Python (SymPy) to explore and manipulate mathematical expressions.
In the second half, students apply their knowledge by implementing foundational machine learning algorithms entirely from scratch using pure Python, without relying on external machine learning libraries. This hands-on approach strengthens their understanding of training processes, optimisation, regularisation, evaluation, and convergence—and more importantly, equips them with the skills needed to design and implement tailored machine learning algorithms for complex, real-world problems.
By the end of the course, students will be able to explain and apply the mathematical concepts behind machine learning and build foundational models through low-level Python implementations, forming a strong base for advanced development and customisation in future projects.
Course Content
- Vector operations: length, unit vectors, dot product, angles
- Matrix operations: transpose, inverse, determinant
- Linear transformations and matrix-vector products
- Solving systems of linear equations using matrices
- Derivatives, partial derivatives, and gradients
- Symbolic computation and differentiation in Python using SymPy
- Computing limits and manipulating expressions in Python
- Gradient descent optimisation
- Linear regression implemented from scratch in pure Python
- Logistic regression implemented from scratch in pure Python
- K-means clustering implemented from scratch in pure Python
Prerequisites
- Introduction to Programming with Python (Y1A1)
- Foundational Mathematics (Y1A2)
Recommended Reading
- Mathematics for Machine Learning by Marc Peter Deisenroth, A. Aldo Faisal, and Cheng Soon Ong