COMP9321 · 08 ML workflow and metrics · Lists & facts

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/12

encourage image

There's no tags or description

Looks like no tags are added yet.

13 Terms

1
New cards
The four types of analytics with the sales example.
Descriptive: sales per month. Diagnostic: why sales dropped in March. Predictive: predict May sales. Prescriptive: increase ads in May.
2
New cards
Pick the task from the target.
Category → classification. Number → regression. No target, find groups → clustering. Suggest items → recommendation.
3
New cards
The ML workflow (wrap-up slide).
Define and initialise the model (after preparing data) → train on the training set → validate on unseen data → use it (explore or deploy as an API) → update and re-validate as new data arrives.
4
New cards
Rules for honest evaluation.
Train/validation/test split; tune on validation or CV; test once at the end; fit preprocessing (scaler, imputer, encoder) on training data only; stratify for imbalanced data.
5
New cards
Overfitting vs underfitting: train score, test score, fix.
Overfit: very high train, much lower test → simpler model, pruning, regularisation, more data, CV, ensembles. Underfit: both low → more features, more complex model.
6
New cards
k-NN: the four things you must specify.
A distance metric, k, optional weighting (closer counts more), how to aggregate (majority vote).
7
New cards
k-NN properties (six).
Non-parametric; instance-based/lazy; slow at prediction; needs scaling; sensitive to noise with small k; curse of dimensionality.
8
New cards
Choosing k in k-NN.
k = 1 overfits (noise-sensitive); large k underfits (blurs boundaries). Pick k by cross-validation; odd k for two classes to avoid ties.
9
New cards
Write the formulas: accuracy, precision, recall, F1.
Accuracy = (TP+TN)/all. Precision = TP/(TP+FP). Recall = TP/(TP+FN). F1 = 2·P·R/(P+R).
10
New cards
Why accuracy misleads on imbalanced data (example).
If 99% of transactions are legitimate, always predicting "legitimate" scores 99% accuracy but catches zero fraud (recall = 0).
11
New cards
Worked example: TP=40, FP=10, FN=20. Precision, recall, F1?
Precision = 40/50 = 0.8. Recall = 40/60 ≈ 0.67. F1 = 2·0.8·0.67/(0.8+0.67) ≈ 0.73.
12
New cards
Ways to handle imbalanced classes.
Random undersampling, random oversampling, cluster-based oversampling, SMOTE; class weights; stratified splits; judge by F1/recall. Resample only the training data.
13
New cards
Feature engineering checklist.
Derive variables (tenure, ratios, date parts); encode categories (one-hot/ordinal); scale for distance-based models; log-transform skewed values; remove leakage and IDs.