First exams 2027 · HL only 2027 年首次开考 · 仅 HL

A4.3.10 · Machine learning approaches (HL only)

A4.3.10 · 机器学习方法(仅 HL)

Model Selection and Comparison

模型选择与比较

Every technique in A4.3 solves a real problem well in some situations and poorly in others. Choosing between them is its own skill, one this closing statement of the topic asks for directly.

A4.3 中的每一种技术,在某些情况下都能很好地解决实际问题,在另一些情况下则表现不佳。在它们之间做出选择,本身就是一项技能,而这正是本主题这条收尾的考纲陈述直接要求的。

This statement closes A4.3 by pulling every earlier technique in the subtopic (regression, classification, clustering, association rules, reinforcement learning, genetic algorithms, ANNs, CNNs) into one comparison, rather than teaching a new algorithm of its own.

这条考纲陈述作为 A4.3 的收尾,把本子主题之前的每一种技术(回归、分类、聚类、关联规则、强化学习、遗传算法、ANN、CNN)都纳入一次比较之中,而不是再教一种新算法。

HL only 仅 HL Typically 4–6 marks · AO3 通常 4–6 分 · AO3 Command term: explain 命令词:explain(解释)

Explainer

讲解

No single best model

没有单一的最佳模型

Df

Different algorithms make different assumptions about the data (whether the relationship is linear, whether clusters are spherical, how much data is available). Those assumptions mean the same algorithm can perform very differently on two different problems, so model selection, choosing and comparing candidate algorithms against the actual problem, is a required step, not an afterthought.

不同的算法对数据做出不同的假设(关系是否是线性的、簇是否呈球形、有多少可用的数据)。这些假设意味着同一个算法在两个不同的问题上可能表现得截然不同,所以模型选择,也就是针对实际问题挑选并比较候选算法,是一个必要的步骤,而不是事后才想起来的补充。

Explore

探索

Five factors in the choice

选择中的五个因素

Click each factor to see why it matters and how it can push the choice one way or another.

点击每个因素,看看它为什么重要,以及它如何把选择推向某一个方向。

Explainer

讲解

Comparing candidate algorithms

比较候选算法

A veterinary clinic wants to predict whether a dog needs a follow-up visit, from its age, weight and the reason for the current visit. Three genuinely different algorithms could all be tried.

一家兽医诊所想根据一只狗的年龄、体重和本次就诊的原因,预测它是否需要复诊。三种截然不同的算法都可以拿来尝试。

CandidateFit for this problem
Logistic regressionFast to train, easy to explain to a vet why a case was flagged, but assumes age, weight and visit reason combine in a fairly simple way to drive the outcome
Decision treeAlso easy to explain (a readable set of rules); handles a mix of numeric and categorical features well, but a single deep tree can overfit a small clinic's data set
Neural networkCan capture more complex relationships between age, weight and visit reason, but needs more data to train well and its reasoning is much harder to explain to a vet who wants to understand a flagged case
候选方案是否适合这个问题
逻辑回归训练快,容易向兽医解释一个病例为什么被标记出来,但假定特征与结果之间的关系相当简单
决策树同样容易解释(一套可读的规则);能很好地处理数值型和类别型混合的特征,但单棵很深的树可能会在小诊所的数据集上过拟合
神经网络能捕捉年龄、体重和就诊原因之间更复杂的关系,但需要更多数据才能训练得好,而且它的推理过程对想理解某个被标记病例的兽医来说难解释得多
A real trade-off, not a ranking 一种真实的权衡,而不是排名

With only a few hundred past visits on record and a need to explain flagged cases to staff, the clinic would likely start with the decision tree, not the neural network, even though the network is the more powerful model on paper.

如果记录在案的过往就诊只有几百次,而且需要向员工解释被标记的病例,那么诊所很可能会从决策树开始,而不是神经网络,即便理论上神经网络是能力更强的模型。

Check your understanding

检验你的理解

A start-up has only 40 rows of labelled sales data and wants to predict which leads will convert. Which factor most strongly argues against starting with a deep neural network here?

一家初创公司只有 40 行带标签的销售数据,想预测哪些潜在客户会转化。哪个因素最有力地反对在这里一开始就用深度神经网络?

Common mistake

常见错误

Recurring assumption that more complex is always better 反复出现的假设:越复杂就一定越好

RecurringDefaulting to "use a neural network" or "use the most advanced model" as the answer to any model-choice question, regardless of the scenario. A more complex model needs more data to avoid overfitting, costs more to train, and is usually harder to explain to a non-technical stakeholder. The right answer names the SPECIFIC factors in the given scenario, how much data there is, how interpretable it needs to be, what kind of problem it is, and explains how each one favours a particular model, not just asserts that a bigger model wins.

反复出现不管场景如何,一律默认"用神经网络"或"用最先进的模型"作为任何模型选择问题的答案。更复杂的模型需要更多数据才能避免过拟合,训练成本更高,而且通常更难向非技术人员解释清楚。正确的答案要指出给定场景中具体的因素,比如数据量、对可解释性的需求、问题的性质,并解释每个因素如何使天平倾向某个特定模型,而不是仅仅断言更大的模型就赢。

✕

Wrong: "The clinic should use a neural network, since it is the most powerful and modern option."

错误: "诊所应该用神经网络,因为它是最强大、最现代的选择。"

✓

Right: "With only a few hundred past visits and a need to explain flagged cases to staff, a decision tree fits better: it needs less data to train reliably and its rules can be read directly, whereas a neural network would likely overfit this small data set and its reasoning would be opaque."

正确: "只有几百次过往就诊记录,又需要向员工解释被标记的病例,决策树更合适:它训练所需的数据更少,而且它的规则可以直接读懂,而神经网络在这个小数据集上很可能会过拟合,而且它的推理过程也不透明。"

Revision questions

复习题

Specimen-paper style. Write an answer, then reveal the marking points and mark yourself.

采用样卷风格。写下答案,然后展开评分要点给自己打分。

Question 1 · 4 marks 第 1 题 · 4 分

[4]Two algorithms are trained on the exact same data set and reach noticeably different levels of accuracy. Explain how this can happen.

[4]解释为什么不同的机器学习算法应用于同一个数据集时可能会给出不同的结果。

Question 2 · 4 marks 第 2 题 · 4 分

[4]A team has only a small, fairly noisy data set to work with. Explain how that should influence which model they pick.

[4]解释可用数据的数量和质量等数据特征,如何影响模型的选择。

Question 3 · 4 marks 第 3 题 · 4 分

[4]Explain how computational resources can influence the choice of algorithm, particularly for a deep learning model.

[4]解释计算资源如何影响算法的选择,尤其是对深度学习模型而言。

Question 4 · 4 marks 第 4 题 · 4 分

[4]Walk through, step by step, how K-Nearest Neighbours decides which class to give a brand new data point.

[4]解释 K 最近邻算法如何对一个新的数据点进行分类。

Flashcards

记忆卡片

Active recall for this statement’s key terms.

针对本条考纲陈述关键术语的主动回忆练习。

Prototype render · grounded in the IB CS 2027 subject guide and the Hodder and Oxford IB CS 2027 texts for A4.3.10 · not yet wired to live routes