Question: Explain Different Types of Machine Learning.
1. Definition
1. Machine Learning (ML) is a branch of Artificial Intelligence that enables
computers to learn from data and improve their performance without being
explicitly programmed for every task.
2. Machine Learning algorithms identify patterns in data and use them to make
predictions or decisions.
3. Based on the type of data and learning process, Machine Learning is mainly
divided into:
o Supervised Learning
o Unsupervised Learning
o Semi-Supervised Learning
o Reinforcement Learning
2. Mathematical Representation / Formula
A simple representation of Machine Learning is:
Input Data → Learning Algorithm → Model → Prediction / Decision
For supervised learning:
X → Model → Y
Where:
• X = Input features
• Y = Target/output
• Model = Learned relationship between input and output
For reinforcement learning:
State → Action → Reward → New State
3. Types of Machine Learning
1. Supervised Learning
, • The model learns from labelled data.
• Both input and correct output are provided.
• The model learns the relationship between input and output.
• Used for classification and regression.
Examples:
• Email → Spam/Not Spam
• House features → House price
Algorithms: Linear Regression, Decision Tree, KNN, SVM.
2. Unsupervised Learning
• The model learns from unlabelled data.
• No predefined output/label is provided.
• The algorithm finds hidden patterns or groups in the data.
Examples:
• Grouping customers based on purchasing behaviour.
• Finding similar products.
Algorithms: K-Means Clustering, Hierarchical Clustering, PCA.
3. Semi-Supervised Learning
• Uses a combination of small labelled data and large unlabelled data.
• Useful when obtaining labelled data is expensive or time-consuming.
• The labelled data guides the learning process, while unlabelled data helps
improve the model.
Example:
100 labelled images
+
10,000 unlabelled images
↓
,Semi-Supervised Learning
↓
Image Classification
4. Reinforcement Learning
• The agent learns by interacting with an environment.
• It performs actions and receives rewards or penalties.
• The goal is to learn a strategy that maximizes the total reward.
Example:
A game-playing AI:
State → Action → Reward
↑ │
└────────────────┘
If the AI makes a good move → Reward
If it makes a bad move → Penalty
Algorithms: Q-Learning, SARSA, Deep Q-Learning.
4. Diagram
, Also:
Semi-Supervised Learning uses both labelled and unlabelled data.
5. Step-by-Step Example
Suppose we want to build an email spam detection system.
Step 1: Collect Data
Collect many emails.
Step 2: Label Data
Some emails are labelled:
• Spam
• Not Spam
Step 3: Train the Model
The supervised learning algorithm learns patterns from these labelled emails.
Step 4: Give New Email
A new email is given to the trained model.
Step 5: Prediction
The model predicts:
Spam or Not Spam