📚 GCSE WJEC Computer Science: Introduction to Machine Learning Revision Notes | GCSE WJEC 计算机:机器学习入门 考点精讲
Machine learning (ML) is a branch of artificial intelligence that enables computer systems to learn from data and improve their performance over time without being explicitly programmed for every task. For GCSE WJEC Computer Science, you need to grasp the fundamental concepts, types of learning, simple algorithms, and the ethical implications of this transformative technology. These revision notes cover every key point you need for the exam, explained in clear, paired English and Chinese paragraphs.
机器学习 (ML) 是人工智能的一个分支,它使计算机系统能够从数据中学习,并随着时间的推移提高性能,而无需为每项任务显式编程。在 GCSE WJEC 计算机科学考试中,你需要掌握基本概念、学习类型、简单算法,以及这项变革性技术的伦理影响。本复习笔记涵盖考试所需的所有关键点,并以清晰的中英文对照段落进行解释。
1. What is Machine Learning? | 什么是机器学习?
Machine learning is a technique where a computer program uses historical data to identify patterns and make decisions with minimal human intervention. Instead of following rigid, pre-coded rules, the system adjusts its internal parameters based on the data it processes. A classic example is a spam filter that learns to recognise unwanted emails by being exposed to many examples of spam and legitimate messages.
机器学习是一种技术,计算机程序利用历史数据来识别模式,并在最少的人为干预下做出决策。系统不是遵循僵硬的预设规则,而是根据所处理的数据调整其内部参数。一个经典的例子是垃圾邮件过滤器,它通过接触大量垃圾邮件和正常邮件的样本,学会识别不受欢迎的电子邮件。
In the WJEC specification, you are expected to understand that machine learning is a key driver of modern AI applications, including image recognition, natural language processing, and recommendation systems. The core idea is that data + algorithm = model, and the model can then be used to make predictions on new, unseen data.
在 WJEC 考试大纲中,你需要理解机器学习是现代 AI 应用的关键驱动力,包括图像识别、自然语言处理和推荐系统。其核心理念是:数据 + 算法 = 模型,然后该模型可用于对新的、未见过的数据进行预测。
2. Machine Learning vs Traditional Programming | 机器学习与传统编程
In traditional programming, a developer writes explicit rules (code) that define how input data should be transformed into output. For example, to identify a cat in a photo, a programmer would need to hardcode rules about whiskers, ears, and shape – which is extremely difficult. In machine learning, the programmer provides many labelled examples (cat pictures) and the algorithm automatically discovers the rules. The resulting model then classifies new images.
在传统编程中,开发人员编写明确的规则(代码)来定义输入数据应如何转换为输出。例如,要识别照片中的猫,程序员需要硬编码关于胡须、耳朵和形状的规则——这极其困难。而在机器学习中,程序员提供许多带有标签的样本(猫的图片),算法会自动发现规则。然后生成的模型对新图像进行分类。
| Traditional Programming 传统编程 | Machine Learning 机器学习 |
|---|---|
| Data + Rules → Output 数据 + 规则 → 输出 | Data + Answers → Rules (model) 数据 + 答案 → 规则(模型) |
| Programmer defines logic 程序员定义逻辑 | Algorithm learns logic from examples 算法从样本中学习逻辑 |
| Hard to adapt to complex tasks 难以适应复杂任务 | Excels at pattern recognition 擅长模式识别 |
This shift from hand-coded rules to data-driven pattern discovery is why machine learning has become so powerful for tasks like speech recognition, fraud detection, and medical diagnosis.
从手工编码规则到数据驱动模式发现的转变,正是机器学习在语音识别、欺诈检测和医疗诊断等任务中变得如此强大的原因。
3. Types of Machine Learning | 机器学习的类型
Machine learning can be categorised into three main types based on the nature of the feedback available during training: supervised learning, unsupervised learning, and reinforcement learning. Each type addresses fundamentally different problems and uses distinct approaches to extract knowledge from data. WJEC expects you to describe each type and give recognisable examples.
根据训练期间可用反馈的性质,机器学习可分为三种主要类型:监督学习、无监督学习和强化学习。每种类型解决根本不同的问题,并使用不同的方法从数据中提取知识。WJEC 要求你描述每种类型并给出可识别的例子。
- Supervised learning: The algorithm learns from a labelled dataset, where each training example is paired with the correct output (label). The goal is to learn a mapping from inputs to outputs.
- Unsupervised learning: The algorithm works with unlabelled data and tries to find hidden patterns or groupings without any guidance on the correct answer.
- Reinforcement learning: An agent learns by interacting with an environment through trial and error, receiving rewards or penalties for its actions.
- 监督学习:算法从带有标签的数据集学习,每个训练样本都配有正确的输出(标签)。目标是学习从输入到输出的映射。
- 无监督学习:算法处理无标签数据,试图在没有任何正确答案指导的情况下发现隐藏模式或分组。
- 强化学习:智能体通过试错与环境交互,根据其行为获得奖励或惩罚来进行学习。
4. Supervised Learning | 监督学习
Supervised learning is used when you have a clear set of inputs and corresponding correct outputs. The training process feeds the model many labelled examples, and the algorithm iteratively adjusts its parameters to minimise the difference between its predictions and the actual labels. This is akin to a student learning with a textbook that provides answers to practice questions.
当你有明确的输入集合和相应的正确输出时,就使用监督学习。训练过程向模型提供许多带标签的样本,算法迭代调整参数,以最小化其预测值与实际标签之间的差异。这类似于学生用提供了练习题答案的教科书学习。
Two common tasks in supervised learning are:
– Classification: predicting a discrete category, e.g., whether an email is ‘spam’ or ‘not spam’.
– Regression: predicting a continuous numerical value, e.g., the price of a house based on its features.
监督学习中的两个常见任务是:
– 分类:预测一个离散类别,例如判断一封电子邮件是“垃圾邮件”还是“非垃圾邮件”。
– 回归:预测一个连续的数值,例如根据房屋的特征预测其价格。
For WJEC exams, you could be asked to identify the type of supervised learning in a scenario. For instance, predicting a student’s final grade (continuous) is regression, while deciding if a student passes or fails is classification.
在 WJEC 考试中,你可能会被要求识别某个场景中的监督学习类型。例如,预测学生的最终分数(连续值)是回归,而判断学生是否及格则是分类。
5. Unsupervised Learning | 无监督学习
Unsupervised learning deals with datasets that have no pre-assigned labels. The algorithm must discover the underlying structure of the data on its own. The most typical unsupervised task is clustering, where the algorithm groups similar data points together – for example, segmenting customers into distinct groups based on their purchasing behaviour for targeted marketing.
无监督学习处理的是没有预先分配标签的数据集。算法必须自行发现数据的底层结构。最典型的无监督任务是聚类,即算法将相似的数据点归为一组——例如,根据客户的购买行为将其细分为不同的群体,以便进行定向营销。
Another important application is anomaly detection, used in fraud detection: unusual transactions that do not fit any normal cluster are flagged as potential fraud. Unsupervised learning is powerful for exploring data before you even know what you are looking for.
另一个重要应用是异常检测,用于欺诈检测:不符合任何正常聚类的异常交易会被标记为潜在的欺诈行为。无监督学习强大之处在于,在你甚至不知道要寻找什么之前,就可以用它来探索数据。
6. Reinforcement Learning | 强化学习
Reinforcement learning (RL) differs markedly from the previous two types. An agent learns to make a sequence of decisions by interacting with an environment. For each action the agent takes, it receives a reward signal (positive or negative), and its goal is to maximise the cumulative reward over time. No labelled input-output pairs are provided; the agent discovers which actions are best through trial and error.
强化学习(RL)与前两种类型显著不同。智能体通过与环境交互来学习做出一系列决策。智能体每采取一个动作,就会收到一个奖励信号(正向或负向),其目标是随着时间的推移最大化累积奖励。系统不提供带标签的输入-输出对;智能体通过试错发现哪些动作是最好的。
A classic WJEC example is a computer program learning to play a game like chess. The agent explores different moves, and the reward might be +1 for a win, -1 for a loss, and 0 for ongoing play. Through thousands of games, it learns a policy that tells it the best move to make from any board position. Another everyday application is training a robot to walk in a simulated environment.
WJEC 的一个经典示例是计算机程序学习下棋之类的游戏。智能体尝试不同的着法,胜利奖励为 +1,失败奖励为 -1,进行中为 0。通过成千上万的对局,它习得一个策略,告诉它从任何棋盘局面应该走哪一步最佳。另一个日常应用是在模拟环境中训练机器人行走。
7. Key Terminology: Features and Labels | 关键术语:特征与标签
Understanding the vocabulary of machine learning is essential. Features are the individual measurable properties or characteristics of the data being used for learning. In a dataset of houses, features might include the number of bedrooms, floor area, and location. Labels are the output we want to predict – for supervised learning, this is the ‘answer’ attached to each example, such as the actual sale price of a house.
理解机器学习的词汇至关重要。特征是用于学习的数据的单个可测量属性或特征。在房屋数据集中,特征可能包括卧室数量、楼层面积和位置。标签是我们想要预测的输出——对于监督学习,这是每个样本附带的“答案”,比如房屋的实际售价。
When a dataset contains both features and labels, it is called a labelled dataset. During training, the algorithm learns the relationship between features and labels. The term model refers to the mathematical representation of that learned relationship, which can then be applied to new data where only the features are known.
当数据集同时包含特征和标签时,称为有标签数据集。在训练过程中,算法学习特征与标签之间的关系。术语模型指的是这种已学习关系的数学表示,然后可以应用于仅知道特征的新数据。
Model = Features + Algorithm + Training → Prediction
模型 = 特征 + 算法 + 训练 → 预测
8. Training Data and Testing Data | 训练数据与测试数据
To evaluate how well a machine learning model generalises to new, unseen data, the original labelled dataset is typically split into two parts: training data and testing data. The training set is used to teach the model, allowing it to adjust its internal parameters. The testing set is kept separate and is only used to assess the model’s performance after training is complete.
为了评估机器学习模型对新数据(未见过的数据)的泛化能力,原始的有标签数据集通常被分成两部分:训练数据和测试数据。训练集用于教导模型,使其调整内部参数。测试集则保持分离,仅在训练完成后用于评估模型的性能。
A common split ratio is 80% for training and 20% for testing. If we test on the same data we trained on, the model might simply memorise the answers – this is called overfitting. An overfitted model performs excellently on training data but poorly on new data. The WJEC specification highlights the importance of testing a model properly to ensure it is reliable in real-world use.
常见的分割比例是 80% 用于训练,20% 用于测试。如果我们用训练过的数据来测试,模型可能只是记住了答案——这被称为过拟合。过拟合的模型在训练数据上表现优异,但在新数据上表现不佳。WJEC 大纲强调要正确测试模型,以确保它在实际应用中可靠。
9. Basic Algorithm: Decision Trees | 基本算法:决策树
A decision tree is a simple yet interpretable supervised learning algorithm used for classification and regression. It works by repeatedly splitting the data based on the value of a feature that best separates the classes. The result is a flowchart-like tree structure where each internal node represents a test on a feature, each branch represents the outcome of the test, and each leaf node holds a class label.
决策树是一种简单但可解释的监督学习算法,用于分类和回归。它通过反复根据最能区分各类别的特征值来分割数据。结果是一个类似流程图的树形结构,其中每个内部节点表示对一个特征的测试,每个分支表示测试的结果,每个叶节点持有一个类别标签。
For example, to predict if a customer will buy a product, a decision tree might first split on age: under 30 on one branch, 30 and over on another. Then it may test income, or previous purchase history. The path from root to leaf gives a reason for the prediction, making decision trees easy for humans to understand. In WJEC questions, you might be asked to interpret a simple decision tree diagram.
例如,要预测客户是否会购买产品,决策树可能首先根据年龄分割:一个分支是 30 岁以下,另一个分支是 30 岁及以上。然后它可能测试收入或以往的购买记录。从根到叶的路径给出了预测的原因,使得决策树易于人类理解。在 WJEC 考题中,你可能需要解读一个简单的决策树图。
10. Basic Algorithm: k-Nearest Neighbours | 基本算法:k-最近邻
The k-nearest neighbours (k-NN) algorithm is another intuitive supervised method. To classify a new data point, the algorithm finds the k closest points (neighbours) in the training set, based on a distance metric such as Euclidean distance. The new point is then assigned the class that is most common among those k neighbours. If k=3, the three nearest neighbours vote on the label.
k-最近邻(k-NN)算法是另一种直觉式的监督学习方法。为了对一个新数据点进行分类,算法根据某个距离度量(如欧几里得距离)在训练集中找到 k 个最近的点(邻居)。然后,新点被分配为这 k 个邻居中最常见的类别。如果 k=3,则由最近的三个邻居投票决定标签。
k-NN is called a ‘lazy learner’ because it doesn’t build an explicit model during training; it simply stores the training data and waits until it needs to make a prediction. The choice of k affects performance: a very small k (like 1) can be influenced by noise, while a large k smooths the decision boundary but may ignore local patterns. Euclidean distance between two points (x₁,y₁) and (x₂,y₂) is calculated as:
k-NN 被称为“惰性学习者”,因为它在训练过程中不建立明确的模型;它只是存储训练数据,等到需要进行预测时才计算。k 值的选择会影响性能:过小的 k 值(如 1)会受噪声影响,而较大的 k 值会平滑决策边界,但可能忽略局部模式。两点 (x₁,y₁) 和 (x₂,y₂) 之间的欧几里得距离计算公式为:
d = √[(x₂ – x₁)² + (y₂ – y₁)²]
11. Introduction to Neural Networks | 神经网络简介
Neural networks are a powerful class of machine learning models inspired by the human brain. They consist of interconnected layers of nodes (neurones). Each connection has a weight that is adjusted during training. A typical simple neural network has an input layer (features), one or more hidden layers, and an output layer (prediction). The hidden layers allow the network to learn complex, non-linear relationships.
神经网络是一类强大的机器学习模型,其灵感来自人类大脑。它们由相互连接的节点(神经元)层组成。每个连接都有一个在训练过程中调整的权重。一个典型的简单神经网络有一个输入层(特征)、一个或多个隐藏层和一个输出层(预测)。隐藏层使网络能够学习复杂的非线性关系。
For GCSE, understanding the basic structure is sufficient. Data flows from the input layer, gets multiplied by weights, summed, and passed through an activation function to introduce non-linearity. This is repeated through the hidden layers until the output layer produces a result. A process called backpropagation computes how much each weight contributed to the error, and the weights are updated to reduce the error in the next iteration. Deep learning refers to neural networks with many hidden layers.
对于 GCSE,理解基本结构就足够了。数据从输入层流入,乘以权重后求和,并通过激活函数引入非线性。这一过程在隐藏层中重复,直到输出层产生结果。一个叫做反向传播的过程计算每个权重对误差的贡献程度,然后更新权重以在下一次迭代中减少误差。深度学习指的就是具有多个隐藏层的神经网络。
12. Ethical Considerations | 伦理考量
As machine learning becomes more widespread, its ethical implications are an important topic in WJEC Computer Science. Issues include bias and fairness: if the training data reflects societal biases (e.g., historical hiring data biased against a particular gender), the model may learn and perpetuate those biases, leading to unfair outcomes. Another concern is transparency and explainability – complex models like deep neural networks can be ‘black boxes’, making it hard to understand why a decision was made.
随着机器学习变得越来越普遍,其伦理影响成为 WJEC 计算机科学的重要主题。问题包括偏见与公平性:如果训练数据反映了社会偏见(例如,历史上的招聘数据对某一性别存在偏见),模型可能会学习并延续这些偏见,导致不公平的结果。另一个关注点是透明度和可解释性——像深度神经网络这样的复杂模型可能是“黑箱”,让人很难理解决策是如何做出的。
Privacy is also critical: machine learning often requires vast amounts of personal data, raising questions about consent and data protection. Finally, accountability – if an autonomous system causes harm, it must be clear who is responsible: the developer, the user, or the machine itself? WJEC expects you to discuss these ethical dimensions and recognise that technology must be designed and used responsibly.
隐私也至关重要:机器学习通常需要大量个人数据,这引发了关于知情同意和数据保护的问题。最后是问责制——如果自主系统造成伤害,必须明确谁负责:开发人员、用户还是机器本身?WJEC 要求你讨论这些伦理维度,并认识到技术必须负责任地设计和应用。
Published by TutorHao | Computing Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导