Why Does AI Need Data?
In the previous lesson, we looked at the basic journey through an AI system:
Input → Processing → Model → Output
But where does the model get its ability to produce useful outputs?
For many modern AI systems, the answer begins with data.
Data provides examples from which machine learning systems can learn patterns.
For example, if we want to build a system that can recognize cats in photographs, we need examples of photographs and information that helps the system learn what characteristics are associated with cats.
Data Is More Than Just Numbers
When people hear the word data, they sometimes imagine spreadsheets full of numbers.
In AI and machine learning, data can take many forms.
- Text
- Images
- Audio
- Video
- Numbers
- Sensor readings
- Business records
- User interactions
The type of data depends on the problem the AI system is designed to solve.
Examples Become Training Data
A machine learning system can learn from examples contained in its training data.
Imagine building a system that predicts whether an email is spam.
The training dataset could contain many examples of emails that have previously been identified as spam or legitimate.
Each example provides information that can help the model discover patterns.
Over many examples, the model can learn relationships that may help it make predictions about new emails.
What Is a Model?
A model is a mathematical system that has been designed to learn patterns from data and use those patterns to produce useful outputs.
Before training, a machine learning model does not necessarily contain the useful patterns required for the task.
Training adjusts the model internal parameters so that it becomes better at the task.
The trained model can then be used to process new inputs.
Training Connects Data and the Model
Training is the process that connects the training data to the model.
A simplified training loop looks like this:
- The model receives a training example.
- The model produces a prediction.
- The prediction is compared with the expected result when one is available.
- An error or loss is calculated.
- The model parameters are adjusted.
- The process is repeated across many examples.
After many iterations, the model may become much better at the task.
What Does the Model Actually Learn?
The model is not necessarily learning a simple list of rules.
Instead, training adjusts internal numerical parameters so that the model becomes better at identifying useful patterns and relationships.
For example, an image recognition model might gradually become sensitive to patterns associated with shapes, textures, edges, colours, and combinations of visual features.
The exact internal representation can be extremely complicated, especially in modern deep learning systems.
At a beginner level, the important idea is that training changes the model internal parameters based on information contained in the data.
A Simple Analogy
Imagine a student preparing for an examination.
The student studies many examples and receives feedback about which answers are correct and incorrect.
Over time, the student changes their understanding based on that experience.
Machine learning is not identical to human learning, but the analogy helps illustrate the basic idea:
Examples + feedback + repeated practice → improved performance.
Training Examples vs New Examples
There is an important difference between the data used to train a model and the new data presented after training.
During training, the model uses examples to adjust its parameters.
During inference, the trained model processes new input and produces an output.
For example:
Training: The model learns from thousands of examples of spam and legitimate emails.
Inference: The trained model receives a new email and predicts whether it is likely to be spam.
Why More Data Can Help
In many machine learning problems, additional useful training examples can help a model learn a broader range of patterns.
Imagine trying to build an image recognition system using only ten photographs.
Those photographs may not represent the full variety of situations the system will encounter.
Adding more varied examples can give the model more information about the problem.
However, simply collecting more data does not automatically guarantee a better model.
Data Quality Matters
Training data needs to be useful and appropriate for the task.
If the data contains errors, misleading information, missing values, or other problems, the model can learn from those problems.
This leads to a common principle in machine learning:
Garbage in, garbage out.
The phrase is simple, but the underlying idea is important. A sophisticated model cannot automatically turn poor training data into perfect knowledge.
Data Needs to Represent the Real World
Suppose we want to create a system that recognizes road signs.
If the training images contain only signs photographed during bright daylight, the model may struggle when it encounters signs at night, in rain, from unusual angles, or partially blocked by objects.
The training data should ideally contain examples that represent the situations in which the system will actually be used.
This is one reason data collection and preparation are major parts of AI projects.
Labels and Supervised Learning
Some machine learning systems learn from examples that include known answers called labels.
This is commonly associated with supervised learning.
For example, a dataset for detecting spam might contain:
- Email A → Spam
- Email B → Not Spam
- Email C → Spam
The model can compare its predictions with the known labels during training.
This gives the training process a way to measure error and improve the model.
Not All Learning Uses Labels
Not every machine learning problem has a clearly defined label for every example.
Some approaches allow systems to discover patterns or structures within data without being given a correct answer for each example.
For example, a system might analyze customer behaviour and discover groups of customers with similar patterns.
We will explore different approaches to machine learning later in the course.
Training, Validation and Test Data
Machine learning projects often divide available data into separate groups.
Training data is used to train the model.
Validation data can be used during development to evaluate choices and help improve the system.
Test data is kept separate and used to evaluate the final model.
The exact way these datasets are created depends on the project.
The important principle is that we need a way to evaluate whether a model can perform well on data beyond the examples used to train it.
Why Testing on New Data Matters
Imagine a student who memorizes every answer in a practice test.
If the final examination contains exactly the same questions, the student may score very highly.
But if the questions are changed, the student may discover that they did not really understand the subject.
Machine learning models can have a similar problem.
A model can perform extremely well on training data while performing poorly on new data.
This is one of the reasons evaluation on separate data is important.
Overfitting
When a model becomes too closely adapted to its training data and performs poorly on new data, we call this overfitting.
Overfitting can happen for many reasons.
It is one of the central challenges in machine learning because the goal is not simply to perform well on the training examples.
The goal is to learn patterns that generalize.
Generalization
Generalization means that a model can perform well on new data that it did not encounter during training.
This is one of the most important measures of whether a machine learning system has learned something useful.
A model that generalizes well has learned patterns that remain useful beyond the exact examples used during training.
Data and Models Work Together
It is tempting to think that the model is the only important part of an AI system.
In reality, the data, training process, model architecture, evaluation methods, and deployment environment all matter.
A powerful model trained on poor or unrepresentative data can still produce poor results.
Likewise, high-quality data cannot automatically guarantee that every model will perform well.
Good AI systems require these pieces to work together.
The Bigger Picture
We can now connect the major concepts:
Data → Training Process → Model → Inference → Output
Data provides examples.
The training process uses those examples to adjust the model.
The trained model processes new inputs during inference.
The system then produces an output such as a prediction, classification, recommendation, or generated response.
Why This Matters for Modern AI
Modern AI systems can be extremely large and sophisticated, but the fundamental relationship between data, training, and models remains important.
Understanding this relationship makes it easier to understand concepts such as neural networks, large language models, and generative AI.
These technologies build on the same broad idea: systems learn useful patterns from data through a training process.
What Comes Next?
We now understand the role of data and training.
The next question is:
What kind of model is capable of learning these complex patterns?
That brings us to one of the most important ideas in modern AI: neural networks.