Practice Flashcards
What does linear regression predict?
Track your progress — Sign up free to save your progress and get smart review reminders based on spaced repetition.
All Flashcards in Topic 4.3
Below are all 50 flashcards for this topic. Sign up free to track your progress and get personalized review schedules.
4.3.15 cards
What does linear regression predict?
A **continuous** value, by fitting $y = mx + c$ through the data.
How is the best line chosen?
By minimising the **sum of squared residuals** — least squares. Squaring stops errors cancelling and punishes large ones heavily.
What does the gradient mean?
The change in the predicted value **per unit** of the input — for example price per square metre. It is the interpretable part of the model.
Why is extrapolation dangerous?
The line continues forever but reality may not. The model has no notion of the range it was trained on and reports **no uncertainty**.
Regression or classification?
"**How much?**" is regression — a number on a scale. "**Which one?**" is classification — a category.
4.3.105 cards
What does model selection weigh besides accuracy?
**Explainability**, speed at prediction, data needed, cost, and **which error is worse** — any of which can outrank accuracy.
Why measure a baseline first?
If the complicated model barely beats a majority-class guesser or a linear fit, the **complexity is not earning its place**.
Is a 0.3 percentage-point accuracy gap meaningful?
Usually **no** — within the variation between cross-validation folds it is noise. Decide on the criteria that genuinely differ.
When does interpretability outrank accuracy?
When a decision must be **justified or audited** — lending, medicine, recruitment. An unexplainable model is then not deployable at any accuracy.
How must candidate models be compared?
On the **same** training and test data, ideally the same **cross-validation folds**, with the test set opened **once** at the end.
4.3.25 cards
What does classification predict?
Which **category** something belongs to, learned from labelled examples — binary (two) or multi-class.
Precision or recall — which is which?
**Precision**: of those flagged, how many really were? **Recall**: of the real cases, how many were caught?
Why is accuracy misleading on rare events?
A model answering "no" every time scores 99.9% on a 1-in-1,000 condition and finds **nothing**. Ask what a majority guesser would score.
What does lowering the decision threshold do?
Catches **more real cases** at the cost of **more false alarms** — recall rises, precision falls. It is a human judgement about which error is worse.
Which error is worse: spam filter or cancer screening?
Opposite. Spam: a **false positive** (a real email lost) is worse. Screening: a **false negative** (a missed tumour) is worse.
4.3.35 cards
Parameter or hyperparameter — how do you tell?
Ask whether it was **chosen before training started**. If the model worked it out from the data, it is a parameter.
What does the learning rate control?
How big a step each update takes. **Too high** overshoots the minimum and never settles; **too low** never arrives in the time available.
Why are three data sets used?
**Training** learns parameters, **validation** chooses hyperparameters, **test** is opened once to report. Tuning on the test set leaks it.
What is cross-validation?
Splitting into k folds, training on k−1 and testing on the held-out one, rotating — so every record is tested exactly once.
Grid search or random search?
**Grid** tries every combination and is exponentially expensive. **Random** samples within ranges and usually finds something good sooner, because few hyperparameters matter much.
4.3.45 cards
What does clustering do?
Groups similar records with **no labels** — the groups are the output, which is what makes it unsupervised.
What are the steps of k-means?
Choose k, place centres at random, **assign** each point to the nearest, **move** each centre to the mean of its members, repeat until stable.
Why can k-means give different answers on the same data?
The starting centres are **random** and it finds a **local** optimum, so where it settles depends on where it began.
Why must features be scaled before clustering?
k-means uses **distance**, so a feature measured in thousands dominates one measured in units — income would decide the clusters entirely.
What does clustering NOT tell you?
What the clusters **mean**. It returns "cluster 0, 1, 2"; naming them is a human interpretation that nothing validates.
4.3.55 cards
What does association rule learning find?
Items that **occur together**, written {A} → {B}. Unsupervised — nothing is being predicted.
Support, confidence, lift — what is each?
**Support** = both ÷ all baskets. **Confidence** = both ÷ baskets with A. **Lift** = confidence ÷ how often B occurs anyway.
What does lift tell you?
**>1** occur together more than chance (real) · **=1** independent · **<1** less than chance. It is what separates a finding from a popular item.
Why is confidence alone misleading?
It rewards whatever is **popular**. 80% confidence is worthless if the consequent appears in 90% of baskets anyway — lift would be 0.89.
Is {A} → {B} the same as {B} → {A}?
**No.** Support is identical, but **confidence differs** — everyone buying caviar buys bread; almost nobody buying bread buys caviar.
4.3.65 cards
How does reinforcement learning differ from supervised learning?
Supervised learning is told **the correct answer**. Reinforcement learning is told only **how well things went** — a reward, often long afterwards.
Name the components of a reinforcement learning system.
**Agent**, **environment**, **state**, **action**, **reward** — and the **policy**, which maps states to actions and is what is actually learned.
What is the exploration–exploitation trade-off?
Whether to **exploit** the best action known so far or **explore** another in case it is better. Only exploiting never improves; only exploring never benefits.
What is credit assignment?
Working out **which** of many earlier actions earned a reward that arrived much later — a game won after 200 moves.
What is reward hacking?
The agent maximising **exactly what was measured** rather than what was meant. The system works perfectly; the objective was wrong.
4.3.75 cards
What are the stages of a genetic algorithm?
**Population → fitness → selection → crossover → mutation → repeat.**
When is a genetic algorithm appropriate?
When the search space is **too large to enumerate**, no formula gives the answer, candidates can be **scored**, and "good enough" is acceptable.
Crossover or mutation — which introduces novelty?
**Mutation.** Crossover only recombines values already in the population; mutation can produce one present in neither parent.
What happens if the mutation rate is too high?
It becomes a **random search** — good solutions are destroyed as fast as they are found.
Does a genetic algorithm find the optimal solution?
**No** — a good one. There is no optimality guarantee, and two runs can give different answers.
4.3.85 cards
What does one unit in a neural network compute?
Each input **times a weight**, summed, **plus a bias**, passed through an **activation function**.
Name the three kinds of layer.
**Input** (one unit per feature), **hidden** (where the work happens), **output** (one unit per class).
Why is a non-linear activation essential?
Without it, stacked layers collapse into a **single weighted sum** — a hundred layers would have the power of one.
What is backpropagation?
Working **backwards** from the error to find each weight's contribution, so every weight can be nudged in the direction that reduces it.
What does training change, and what does it not?
It changes the **weights and biases**. The number of layers, units and the activation function are **hyperparameters**, fixed beforehand.
4.3.95 cards
What does convolution do in a CNN?
Slides a small **filter** of weights across the input, multiplying and summing at each position to produce a **feature map** of where that pattern occurs.
Why are shared weights important?
The **same** filter is used at every position, so a feature is recognised **wherever it appears** — and one detector costs a handful of weights rather than a set per location.
What is pooling for?
Keeping the strongest value in each block: **fewer numbers** to carry forward, and tolerance to small shifts in position.
What do successive CNN layers learn?
**Edges**, then shapes built from edges, then objects built from shapes — a hierarchy that is learned rather than designed.
Why is flattening an image a problem?
It **destroys the geometry** — the network no longer knows which pixels were adjacent — and a 200×200 colour image gives 120,000 inputs, needing millions of weights.
Topic 4.3 study notes
Full notes & explanations for Machine learning approaches
Computer Science exam skills
Paper structures, command terms & tips
Want smart review reminders?
Sign up free to track your progress. Our spaced repetition algorithm will tell you exactly which cards to review and when.
Start Free