Learning tasks and measurement
Start by identifying the target, the loss and the data used to fit the model. A numerical class code is still a class label. A good training score alone does not establish performance on unseen observations.
1.1 Prediction tasks and model families
Past papers · DA 2024–2026 (3 papers): 2 questions, 2 marks
A supervised dataset is , where is the number of observations, has features, and is the target. Regression predicts a numerical response; classification selects a class. Unsupervised learning uses feature vectors without target labels.
| Task or model | What is fitted or returned | Key distinction |
|---|---|---|
| Regression | A numerical prediction | Error has target units |
| Classification | A label or class probabilities | A probability threshold converts scores to labels |
| Clustering | Groups of similar observations | Cluster numbers are arbitrary identifiers |
| Dimensionality reduction | A smaller feature representation | PCA uses variation; LDA uses labels |
| Generative classification | Class prior and class-conditional distribution | Naive Bayes and probabilistic LDA |
| Discriminative classification | A boundary or conditional class probabilities | Logistic regression and SVM |
Feature selection keeps original coordinates; feature extraction constructs new coordinates. PCA and Fisher LDA are extraction methods. Sampling is a separate task; Markov chain Monte Carlo belongs to the Artificial Intelligence handbook.
1.2 Losses and regularisation
Past papers · DA 2024–2026 (3 papers): 1 question, 2 marks
Let , where collects the parameters. Training minimises a chosen loss. Model evaluation may use a different metric; always use the quantity specified in the question.
For squared error, the best constant prediction is the target mean; for absolute error it is any target median; for zero-one loss it is a most frequent class. These follow by differentiating the quadratic, balancing absolute-error slopes, and counting correct predictions respectively.
1.3 Classification scores
Past papers · DA 2024–2026 (3 papers): 1 question, 2 marks
Choose a positive class before constructing a confusion matrix. In multiclass questions, treat the named class as positive and every other class as negative.
| Actual / predicted | Positive | Negative |
|---|---|---|
| Positive | TP: true positive | FN: false negative |
| Negative | FP: false positive | TN: true negative |
Macro averaging takes the unweighted mean of the per-class scores. Micro averaging pools the per-class TP, FP and FN first; in single-label multiclass classification, micro precision, recall and equal accuracy. A ROC curve plots TPR against FPR while the threshold varies. Lowering a positive-score threshold cannot decrease either rate on a fixed dataset.
Last-minute recall
- Regression targets are numerical; class numbers are labels.
- Naive Bayes and LDA model class-conditional distributions.
- Squared loss and absolute loss have different units and different minimisers.
- An average loss and a summed loss need different penalty weights for the same fit.
- Fix the positive class before computing precision or recall.
- Accuracy can hide poor performance on a small class.