Computer ScienceChapter 4: Data and Analysis
4.1.5 Machine Learning Models
A Machine Learning Model
Explanation level
Introduction
Machine learning models are the core of modern artificial intelligence. They allow computers to learn from data and make decisions or predictions without being explicitly programmed for every task. There are three primary models of machine learning, each suited to different types of problems.
Definition
A Machine Learning Model is a mathematical representation of a real-world process that is trained on data to make predictions or decisions.
Main Idea
Primarily, there are three models of machine learning:
- Supervised Machine Learning Model
- Unsupervised Machine Learning Model
- Reinforcement Machine Learning Model
Each model learns differently and is used for different types of problems.
Core Concept
| Model | Type of Data | Learning Method | Example |
|---|---|---|---|
| Supervised | Labeled data | Learns from questions with answers | Fruit classification |
| Unsupervised | Unlabeled data | Finds patterns and groups | Customer segmentation |
| Reinforcement | Feedback (rewards/penalties) | Learns by trial and error | Chess, robotics |
Detailed Explanation
Do You Know?
TensorFlow: TensorFlow framework is a tool that helps a computer form data like a robot. TensorFlow learns form data like a human being learn form experience.
Deep Learning: Deep learning is a type of computer learning which uses layers of artificial neural network to learn from data. It is a learning method which is implemented by using some tool like TensorFlow.
Neural Network: Neural network is also known as Artificial Neural Network. It is a system designed to work like a human brain. It is made up of artificial neurons. These tiny neurons make decisions like human brain.
Supervised Learning Model
In this learning model, a set of labeled data is provided to the machine/computer. The labeled data means that questions with their correct answers are provided to the machine. After reading/learning a lot of questions/answers, the machine is trained. Now, only new questions without correct answers are provided to that machine, and it provides us with the possible correct answers.
Example: If we provide the features (labels) of types of fruits, i.e., shape, color, and texture, and give their names (answers) as well. After the machine is trained, when we will give the features of a new fruit, the supervised learning model will predict/provide the name of that fruit.
- Uses labeled data.
- Learns from examples with known answers.
- Predicts answers for new data.
- Common in classification and regression.
Unsupervised Learning Model
In the unsupervised learning model, unlabeled data is provided to the machine/computer. The algorithm identifies the pattern in the data and divides it into groups based on similarities and differences. When the training is completed, the computer can identify new data and put it in the relevant category.
- Uses unlabeled data.
- Finds patterns and groups on its own.
- No correct answers provided during training.
- Common in clustering and association.
Reinforcement Learning Model
In reinforcement learning, the machines are trained with the help of positive or negative feedback. To explain reinforcement learning, we will use the following key terms:
- Agent (machine/computer)
- Environment (where agent takes actions)
- Actions (moves made by agent)
- Rewards (points for helpful actions)
- Penalties (points deducted for unhelpful actions)
The agent is provided with an environment where it must take certain actions. If the action is helpful towards the desired solution, the agent will be rewarded with some points through feedback. If the actions are not helpful towards the desired solution, the agent will be penalized (punished) by deducting the points. The agent improves its actions based on the feedback. This model is used to get optimal results.
Example: If you are learning to play chess and whenever you start your game by moving knights (name of a piece in chess game) you win, you will always try to start your game by moving knights. On the other hand, whenever you start your game by moving the Queen piece, you lose the game. Therefore, you will always avoid moving the Queen piece in the beginning of the game in future. In this way, by winning and losing the game by moving certain pieces, you have learned winning moves. In reinforcement learning, this process is continuous until the model is trained and provides accurate results.
- Learns through rewards and penalties.
- Agent interacts with an environment.
- Improves actions based on feedback.
- Common in games, robotics, and navigation.
Intermediate Level
At the intermediate level, you should understand when to use each model.
| Model | When to Use | Example |
|---|---|---|
| Supervised | You have labeled data | Email spam detection |
| Unsupervised | You have unlabeled data | Customer segmentation |
| Reinforcement | You need to learn by interaction | Game playing, robotics |
- Supervised = questions with answers.
- Unsupervised = no answers, find patterns.
- Reinforcement = learn by rewards and penalties.
Important Points
- - Three main models: Supervised, Unsupervised, Reinforcement.
- - Supervised uses labeled data.
- - Unsupervised uses unlabeled data.
- - Reinforcement uses rewards and penalties.
- - Supervised: predicts answers.
- - Unsupervised: finds patterns.
- - Reinforcement: learns by interaction.
- - TensorFlow, Deep Learning, Neural Networks are key concepts.
Remember
- - Supervised = labeled data.
- - Unsupervised = unlabeled data.
- - Reinforcement = rewards/penalties.
- - Supervised = questions with answers.
- - Unsupervised = find patterns.
- - Reinforcement = learn by trial and error.
- - TensorFlow = ML framework.
- - Neural Network = artificial brain.
Common Mistakes
- - Confusing supervised with unsupervised learning.
- - Thinking that reinforcement learning does not need data (it learns from interaction).
- - Assuming that unsupervised learning is always better (it depends on the problem).
- - Confusing labeled data with unlabeled data.
- - Thinking that neural networks are only used in supervised learning (they can be used in all three).
- - Forgetting that reinforcement learning uses rewards and penalties.
- - Confusing TensorFlow with a programming language (it is a framework).
Quick Revision
- Three models: Supervised, Unsupervised, Reinforcement.
- Supervised: labeled data, learns from examples with answers.
- Unsupervised: unlabeled data, finds patterns and groups.
- Reinforcement: rewards and penalties, learns by interaction.
- Example: fruit classification (supervised), customer segmentation (unsupervised), chess (reinforcement).
- TensorFlow, Deep Learning, Neural Networks are key concepts.
60-Second Revision
- Three models: Supervised, Unsupervised, Reinforcement.
- Supervised = labeled data.
- Unsupervised = unlabeled data.
- Reinforcement = rewards/penalties.
- Supervised = answers; Unsupervised = patterns; Reinforcement = trial and error.
- Warning: Don't confuse supervised with unsupervised; supervised has labeled data, unsupervised does not.
Did you understand this topic?
Your answer is saved with your learning record. It does not mark the topic as mastered.
Quick revision
Revision Zone
Review the key facts, formulas and checks before you move on.4.1.5 Machine Learning Models
Sticky Notes · Quick Revision
Key Point 1
- Supervised = labeled.
Key Point 2
- Unsupervised = unlabeled.
Key Point 3
- Reinforcement = rewards/penalties.
Key Point 4
- Supervised = answers.
Key Point 5
- Unsupervised = patterns.
Key Point 6
- Reinforcement = trial and error.
Key Point 7
- TensorFlow = framework.
Key Point 8
- Neural Network = artificial brain.
Same supplied content as this Notes page (shared canonical source).