Bea Taylor - bea.taylor@ucl.ac.uk
8th December 2026
CASA0007 Quantitative Methods
Lecture 8 was on multilevel regression
Looked at:
Image credit: Google Gemini
By the end of this lecture you should be able to:
Two main categories of machine learning.
Machine learning techniques that use labelled datasets to train models to identify underlying patterns.
Machine learning techniques that identify patterns in unlabeled datasets.
Principal component analysis (PCA) and Clustering are both types of unsupervised learning.
Dimensionality refers to the number of features or variables in a dataset.
Image credit: www.photofacts.nl
Canon EOR R8 has a maximum resolution of 6000 * 4000 pixels for JPEG/HEIF, where every pixel corresponds to three colour channels (RGB).
What is the dimensionality of an image from EOR R8?
You are given the following dataset with 1000 rows and 3 columns.
| x1 | x2 | month | |
|---|---|---|---|
| 0 | 1.2 | 4.5 | Jan |
| 1 | 3.4 | 2.2 | Feb |
| 2 | -0.5 | 3.3 | Mar |
| 3 | 2.1 | -1.1 | Apr |
| 4 | 0.0 | 0.7 | May |
| … | … | … | … |
What is the dimensionality of the feature space for this dataset after one-hot encoding of the month column (with one category dropped)?
The curse of dimensionality!
When data has a large number of dimensions:
Mathematical projection of a sphere onto a plane. The stereographic projection is conformal, meaning that it preserves angles. However, it does not preserve area or distance.
Source: LibreTexts Mathematics.
The Gall-Peters projection is an equal-area cylindrical map projection. It preserves area but distorts shapes, especially near the poles.
Source: Wikipedia.
*Pearson, Karl. “LIII. On lines and planes of closest fit to systems of points in space.” The London, Edinburgh, and Dublin philosophical magazine and journal of science 2.11 (1901): 559-572
Image credit: Mathematics for Machine Learning
No hard and fast rule to choose the number of principal components, but there are some general guidelines.

| Attribute | Description |
|---|---|
| PTFSM6CLA1A | Percentage of pupils eligible for Free School Meals in the past six years (FSM6) and/or Children Looked After (CLA1A). |
| PTNOTFSM6CLA1A | Percentage of pupils not eligible for FSM6 and not CLA1A. |
| PNUMEAL | Percentage of pupils whose first language is known or believed to be other than English. |
| PNUMFSMEVER | Percentage of pupils who have ever been eligible for Free School Meals in the past six years (FSM6 measure). |
| ATT8SCR_FSM6CLA1A | Average Attainment 8 score for pupils eligible for FSM6 and/or CLA1A. |
| ATT8SCR_NFSM6CLA1A | Average Attainment 8 score for pupils not eligible for FSM6 and not CLA1A. |
| ATT8SCR_BOYS | Average Attainment 8 score for male pupils. |
| ATT8SCR_GIRLS | Average Attainment 8 score for female pupils. |
| P8MEA_FSM6CLA1A | Progress 8 measure for disadvantaged pupils (FSM6 and/or CLA1A). |
| P8MEA_NFSM6CLA1A | Progress 8 measure for non-disadvantaged pupils. |
Source: R in Action
Example of PCA on the MNIST dataset.
Source: Chapter 10, Mathematics for Machine Learning
Source: Ajtai, I., Ștefănie, H., Maloș, C., Botezan, C., Radovici, A., Bizău-Cârstea, M., & Baciu, C. (2023). Mapping social vulnerability to floods. A comprehensive framework using a vulnerability index approach and PCA analysis. Ecological Indicators, 154, 110838.
© CASA | ucl.ac.uk/bartlett/casa