Back to all Computer Science topics
Topic 4.3Computer Science HL50 flashcards

Machine learning approaches

Practice Flashcards

Flip cards to reveal answers
Card 1 of 504.3.1
4.3.1
Question

What does linear regression predict?

Click to reveal answer

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

Card 1definition
Question

What does linear regression predict?

Answer

A **continuous** value, by fitting $y = mx + c$ through the data.

Card 2process
Question

How is the best line chosen?

Answer

By minimising the **sum of squared residuals** — least squares. Squaring stops errors cancelling and punishes large ones heavily.

Card 3concept
Question

What does the gradient mean?

Answer

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.

Card 4concept
Question

Why is extrapolation dangerous?

Answer

The line continues forever but reality may not. The model has no notion of the range it was trained on and reports **no uncertainty**.

Card 5comparison
Question

Regression or classification?

Answer

"**How much?**" is regression — a number on a scale. "**Which one?**" is classification — a category.

4.3.105 cards

Card 6concept
Question

What does model selection weigh besides accuracy?

Answer

**Explainability**, speed at prediction, data needed, cost, and **which error is worse** — any of which can outrank accuracy.

Card 7concept
Question

Why measure a baseline first?

Answer

If the complicated model barely beats a majority-class guesser or a linear fit, the **complexity is not earning its place**.

Card 8concept
Question

Is a 0.3 percentage-point accuracy gap meaningful?

Answer

Usually **no** — within the variation between cross-validation folds it is noise. Decide on the criteria that genuinely differ.

Card 9example
Question

When does interpretability outrank accuracy?

Answer

When a decision must be **justified or audited** — lending, medicine, recruitment. An unexplainable model is then not deployable at any accuracy.

Card 10process
Question

How must candidate models be compared?

Answer

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

Card 11definition
Question

What does classification predict?

Answer

Which **category** something belongs to, learned from labelled examples — binary (two) or multi-class.

Card 12comparison
Question

Precision or recall — which is which?

Answer

**Precision**: of those flagged, how many really were? **Recall**: of the real cases, how many were caught?

Card 13concept
Question

Why is accuracy misleading on rare events?

Answer

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.

Card 14concept
Question

What does lowering the decision threshold do?

Answer

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.

Card 15example
Question

Which error is worse: spam filter or cancer screening?

Answer

Opposite. Spam: a **false positive** (a real email lost) is worse. Screening: a **false negative** (a missed tumour) is worse.

4.3.35 cards

Card 16comparison
Question

Parameter or hyperparameter — how do you tell?

Answer

Ask whether it was **chosen before training started**. If the model worked it out from the data, it is a parameter.

Card 17concept
Question

What does the learning rate control?

Answer

How big a step each update takes. **Too high** overshoots the minimum and never settles; **too low** never arrives in the time available.

Card 18process
Question

Why are three data sets used?

Answer

**Training** learns parameters, **validation** chooses hyperparameters, **test** is opened once to report. Tuning on the test set leaks it.

Card 19definition
Question

What is cross-validation?

Answer

Splitting into k folds, training on k−1 and testing on the held-out one, rotating — so every record is tested exactly once.

Card 20comparison
Question

Grid search or random search?

Answer

**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

Card 21definition
Question

What does clustering do?

Answer

Groups similar records with **no labels** — the groups are the output, which is what makes it unsupervised.

Card 22process
Question

What are the steps of k-means?

Answer

Choose k, place centres at random, **assign** each point to the nearest, **move** each centre to the mean of its members, repeat until stable.

Card 23concept
Question

Why can k-means give different answers on the same data?

Answer

The starting centres are **random** and it finds a **local** optimum, so where it settles depends on where it began.

Card 24concept
Question

Why must features be scaled before clustering?

Answer

k-means uses **distance**, so a feature measured in thousands dominates one measured in units — income would decide the clusters entirely.

Card 25concept
Question

What does clustering NOT tell you?

Answer

What the clusters **mean**. It returns "cluster 0, 1, 2"; naming them is a human interpretation that nothing validates.

4.3.55 cards

Card 26definition
Question

What does association rule learning find?

Answer

Items that **occur together**, written {A} → {B}. Unsupervised — nothing is being predicted.

Card 27formula
Question

Support, confidence, lift — what is each?

Answer

**Support** = both ÷ all baskets. **Confidence** = both ÷ baskets with A. **Lift** = confidence ÷ how often B occurs anyway.

Card 28concept
Question

What does lift tell you?

Answer

**>1** occur together more than chance (real) · **=1** independent · **<1** less than chance. It is what separates a finding from a popular item.

Card 29concept
Question

Why is confidence alone misleading?

Answer

It rewards whatever is **popular**. 80% confidence is worthless if the consequent appears in 90% of baskets anyway — lift would be 0.89.

Card 30concept
Question

Is {A} → {B} the same as {B} → {A}?

Answer

**No.** Support is identical, but **confidence differs** — everyone buying caviar buys bread; almost nobody buying bread buys caviar.

4.3.65 cards

Card 31comparison
Question

How does reinforcement learning differ from supervised learning?

Answer

Supervised learning is told **the correct answer**. Reinforcement learning is told only **how well things went** — a reward, often long afterwards.

Card 32definition
Question

Name the components of a reinforcement learning system.

Answer

**Agent**, **environment**, **state**, **action**, **reward** — and the **policy**, which maps states to actions and is what is actually learned.

Card 33definition
Question

What is the exploration–exploitation trade-off?

Answer

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.

Card 34definition
Question

What is credit assignment?

Answer

Working out **which** of many earlier actions earned a reward that arrived much later — a game won after 200 moves.

Card 35concept
Question

What is reward hacking?

Answer

The agent maximising **exactly what was measured** rather than what was meant. The system works perfectly; the objective was wrong.

4.3.75 cards

Card 36process
Question

What are the stages of a genetic algorithm?

Answer

**Population → fitness → selection → crossover → mutation → repeat.**

Card 37concept
Question

When is a genetic algorithm appropriate?

Answer

When the search space is **too large to enumerate**, no formula gives the answer, candidates can be **scored**, and "good enough" is acceptable.

Card 38comparison
Question

Crossover or mutation — which introduces novelty?

Answer

**Mutation.** Crossover only recombines values already in the population; mutation can produce one present in neither parent.

Card 39concept
Question

What happens if the mutation rate is too high?

Answer

It becomes a **random search** — good solutions are destroyed as fast as they are found.

Card 40concept
Question

Does a genetic algorithm find the optimal solution?

Answer

**No** — a good one. There is no optimality guarantee, and two runs can give different answers.

4.3.85 cards

Card 41definition
Question

What does one unit in a neural network compute?

Answer

Each input **times a weight**, summed, **plus a bias**, passed through an **activation function**.

Card 42definition
Question

Name the three kinds of layer.

Answer

**Input** (one unit per feature), **hidden** (where the work happens), **output** (one unit per class).

Card 43concept
Question

Why is a non-linear activation essential?

Answer

Without it, stacked layers collapse into a **single weighted sum** — a hundred layers would have the power of one.

Card 44process
Question

What is backpropagation?

Answer

Working **backwards** from the error to find each weight's contribution, so every weight can be nudged in the direction that reduces it.

Card 45concept
Question

What does training change, and what does it not?

Answer

It changes the **weights and biases**. The number of layers, units and the activation function are **hyperparameters**, fixed beforehand.

4.3.95 cards

Card 46process
Question

What does convolution do in a CNN?

Answer

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.

Card 47concept
Question

Why are shared weights important?

Answer

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.

Card 48definition
Question

What is pooling for?

Answer

Keeping the strongest value in each block: **fewer numbers** to carry forward, and tolerance to small shifts in position.

Card 49concept
Question

What do successive CNN layers learn?

Answer

**Edges**, then shapes built from edges, then objects built from shapes — a hierarchy that is learned rather than designed.

Card 50concept
Question

Why is flattening an image a problem?

Answer

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.

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