Machine Learning — Types of ML
Machine Learning can be divided into three major types based on how the model learns from data.
Types of Machine Learning
Machine Learning
│
├── Supervised Learning
│
├── Unsupervised Learning
│
└── Reinforcement Learning
Types of Machine Learning
1. Supervised Learning
Definition
Supervised Learning is a type of Machine Learning in which the model learns using labeled data.
Labeled data means:
Input → Correct Output already exists
The model learns from examples and then predicts outputs for new data.
Working
Training Data
(Input + Output)
↓
Model learns relationship
↓
Prediction for new data
Example:
Student marks dataset:
Study HoursMarks235455670890
Model learns:
Study Hours → Marks
If:
Study Hours = 5
The model predicts:
Marks ≈ 62
Types of Supervised Learning
A) Regression
Predicts continuous values
Examples:
- House price prediction
- Temperature prediction
- Sales prediction
Algorithms:
- Linear Regression
- Polynomial Regression
- Ridge Regression
- Lasso Regression
B) Classification
Predicts categories/classes
Examples:
- Spam detection
- Disease prediction
- Email classification
Algorithms:
- Logistic Regression
- Decision Tree
- Random Forest
- Support Vector Machine (SVM)
- Neural Networks
Advantages
- High accuracy if labeled data exists
- Easy to evaluate
Disadvantages
- Requires large labeled datasets
- Labeling can be expensive
2. Unsupervised Learning
Definition
Unsupervised Learning is a type of Machine Learning where the model learns from unlabeled data.
Unlabeled data means:
Input exists Output does not exist
The model tries to find hidden patterns and relationships.
Working
Input Data
(No output labels)
↓
Find hidden structure
↓
Groups or patterns
Example:
Customer shopping data:
CustomerAgeAmount SpentA22500B23550C504000D554500
The model may automatically create:
Group 1 → Young customers Group 2 → Older high-spending customers
Types of Unsupervised Learning
A) Clustering
Groups similar data points.
Examples:
- Customer segmentation
- Image grouping
- Market analysis
Algorithms:
- K-Means
- Hierarchical Clustering
- DBSCAN
B) Association
Finds relationships between items.
Example:
People buying bread also buy butter
Algorithms:
- Apriori
- FP Growth
C) Dimensionality Reduction
Reduces features while preserving information.
Examples:
- Data compression
- Visualization
Algorithms:
- PCA
- t-SNE
Advantages
- No labeled data needed
- Finds hidden patterns
Disadvantages
- Harder to evaluate
- Results may be less interpretable
3. Reinforcement Learning
Definition
Reinforcement Learning is a type of Machine Learning where an agent learns by interacting with an environment and receiving rewards or penalties.
The model learns through trial and error.
Working
Agent ↓ Take Action ↓ Environment ↓ Reward/Penalty ↓ Learn
Example:
Teaching a dog:
Sit correctly → Reward Wrong action → No reward
The dog gradually learns.
Another example:
Self-driving car:
Move correctly → +10 reward Hit obstacle → -20 penalty
Components of Reinforcement Learning
- Agent → learner
- Environment → surroundings
- Action → decision taken
- Reward → feedback
- State → current situation
Algorithms
- Q-Learning
- Deep Q Networks (DQN)
- SARSA
- Policy Gradient Methods
Advantages
- Learns automatically through interaction
- Useful for dynamic environments
Disadvantages
- Needs many training iterations
- Computationally expensive
Quick Comparison
SupervisedUnsupervisedReinforcementUses labeled dataUses unlabeled dataUses rewards and penaltiesPredicts outputsFinds hidden patternsLearns actionsTeacher availableNo teacherFeedback availableExample: Spam detectionExample: Customer segmentationExample: Self-driving car
Simple memory trick:
Supervised → Learn with answers Unsupervised → Learn without answers Reinforcement → Learn by rewards
