There is no single recipe that explains every AI system. This guide focuses on a common machine-learning approach and follows a simple example from data to prediction.
1. Data
Machine learning starts with data: examples that give a system information to learn from. A dataset is a collection of examples. It can be arranged in a table, where each row is an example and each column can represent a feature or a label.
A feature is an input detail used by a model. A label is the answer the model is being trained to predict.
Imagine a simple fruit-classifier example. Each example could describe one fruit using features such as size, colour and weight. Its label could be “apple” or “mango”. This is a hypothetical teaching example, not a real dataset.
Sources:
- Google for Developers — Datasets: Data characteristics
- Google for Developers — Datasets: Labels
- Google for Developers — Test Your Understanding
2. Training
In supervised machine learning, a model is trained with examples that already have labels. During training, it uses the examples to learn a relationship between the input features and the label it is meant to predict.
For a linear regression model, Google's course explains that training calculates model parameters called weights and bias. These parameters help the model fit the relationship between features and the label. Other kinds of models can use different training methods, so this is one example rather than a universal recipe.
Training is only one part of creating an AI system. The wider process also includes preparing data, checking the model, putting it into use and monitoring it.
Sources:
- Google for Developers — Test Your Understanding
- Google for Developers — Linear regression
- OECD Recommendation on Artificial Intelligence — AI system lifecycle
3. The Model
The result of training is a model: a learned representation of a relationship that can take input features and produce an output. In a linear regression example, the model uses an equation with weights and a bias. Other model types can be structured differently.
For the fruit example, the model is the part that uses the fruit's recorded features to produce a prediction. It is not a list of hand-written instructions for every possible fruit.
Source:
4. Patterns
While a model is being trained, it learns relationships between examples' features and their labels. Not every feature is equally useful: some input details may have more predictive power for a label than others.
In our hypothetical fruit classifier, a combination of size, colour and weight might help the model distinguish apples from mangoes. The example does not mean that one feature always decides the answer, or that all fruit can be identified by the same simple set of clues.
Sources:
- Google for Developers — Test Your Understanding
- Google for Developers — Linear regression
- Google for Developers — Datasets: Data characteristics
5. Prediction
After training, a model can be given a new example. It receives the available features and produces a prediction. For a classification task, that prediction is a category, also called a class.
In the fruit example, we could provide the size, colour and weight of a fruit the model has not seen before. The model would then predict whether the fruit belongs to the “apple” or “mango” category.
A prediction is the model's output, not a guarantee that the answer is correct.
Source:
6. Why AI Makes Mistakes
A model learns from the data it is given. If examples contain incorrect labels, noisy features or missing information, the model may learn an unreliable relationship. Google's course explains these as data-quality issues that need to be checked and handled.
Another problem is overfitting. This can happen when a model fits its training examples so closely that it does not make correct predictions on new examples. A model should therefore be evaluated with data that was kept separate from the examples used for training.
In the fruit example, a model might struggle if its training examples are labelled incorrectly, leave out useful details, or do not represent the fruits it later encounters. These are illustrative possibilities, not measured results from a real fruit dataset.
Sources:
Editorial note
This article uses a simplified supervised-learning classifier to explain a few core ideas. The apple-versus-mango example is hypothetical and is a general teaching model, not a formula for every AI system. Real AI systems can use different data, model types and methods.
The OECD describes an AI system lifecycle that includes planning and design, data collection and processing, model building, verification and validation, deployment, and operation and monitoring. These phases can be iterative and do not always happen in a fixed sequence.