DEV Community

Cover image for TYPES OF MACHINE LEARNING...
ihsaan muhammed
ihsaan muhammed

Posted on

TYPES OF MACHINE LEARNING...

Types of Machine Learning

Machine Learning (ML) is a branch of Artificial Intelligence (AI) that enables computers to learn from data and make predictions or decisions without being explicitly programmed. The four main types of machine learning are:

Supervised Learning
Unsupervised Learning
Semi-Supervised Learning
Reinforcement Learning

1. Supervised Learning
Definition

Supervised learning is a type of machine learning in which the model is trained using labeled data. Each training example consists of an input and its correct output (label). The algorithm learns the relationship between inputs and outputs so it can predict the output for new, unseen data.
**
Working Process**
Collect labeled training data.
Train the machine learning model.
Learn the mapping between input and output.
Test the model using new data.
Predict the correct output.

Types of Supervised Learning
A. Classification

Used when the output is a category.

Examples

Email Spam Detection (Spam / Not Spam)
Disease Prediction (Positive / Negative)
Handwritten Digit Recognition (0–9)
B. Regression

Used when the output is a continuous value.

Examples

House Price Prediction
Temperature Forecasting
Stock Price Prediction
Common Algorithms
Linear Regression
Logistic Regression
Decision Tree
Random Forest
Support Vector Machine (SVM)
K-Nearest Neighbor (KNN)
Naïve Bayes
**
Advantages**
High prediction accuracy with quality labeled data.
Easy to evaluate performance.
Suitable for classification and regression problems.
Disadvantages
Requires a large amount of labeled data.
Labeling data is time-consuming and expensive.
Can overfit if not properly trained.

Real-Life Example**
**
A bank trains a model using past customer data labeled as "Loan Approved" or "Loan Rejected." The model predicts whether a new applicant should receive a loan.
**

  1. Unsupervised Learning** Definition

Unsupervised learning uses unlabeled data. The algorithm tries to discover hidden patterns, relationships, or groupings in the data without knowing the correct output.

Working Process
Input unlabeled data.
Identify similarities and differences.
Form clusters or discover patterns.
Analyze hidden structures.
Types
A. Clustering

Groups similar data together.

Examples

Customer Segmentation
Image Grouping
News Article Categorization
B. Association

Finds relationships between variables.

Examples

Market Basket Analysis
Product Recommendation Systems
Common Algorithms
K-Means Clustering
Hierarchical Clustering
DBSCAN
Apriori Algorithm
Principal Component Analysis (PCA)

Advantages
No labeled data required.
Finds hidden patterns.
Useful for exploratory data analysis.

Disadvantages
Results may be difficult to interpret.
Accuracy is harder to evaluate.
Sensitive to algorithm selection.
Real-Life Example

An online shopping website groups customers with similar purchasing behavior and recommends products accordingly.

3. Semi-Supervised Learning
Definition

Semi-supervised learning combines a small amount of labeled data with a large amount of unlabeled data. It is useful when labeling data is expensive or difficult.

Working Process**
**Train the model with labeled data.
Use unlabeled data to improve learning.
Generate better predictions.

Applications
Medical Image Analysis
Speech Recognition
Face Recognition
Text Classification
Common Algorithms
Self-Training
Co-Training
Label Propagation
Graph-Based Methods

Advantages
Requires fewer labeled samples.
Better accuracy than unsupervised learning.
Reduces labeling costs.

Disadvantages
Performance depends on the quality of labeled data.
More complex than supervised learning.
Incorrect labels can reduce accuracy.
Real-Life Example

A hospital has 500 labeled X-ray images and 20,000 unlabeled images. The model learns from both to improve disease detection.
**

  1. Reinforcement Learning** Definition

Reinforcement learning is a learning technique where an agent learns by interacting with an environment. The agent receives rewards for good actions and penalties for bad actions, aiming to maximize the total reward.

Components
Agent: Learner or decision-maker.
Environment: The system in which the agent operates.
State: Current situation.
Action: Decision taken by the agent.
Reward: Feedback received after an action.
Policy: Strategy used to choose actions.
Working Process
Observe the environment.
Choose an action.
Receive reward or penalty.
Update the strategy.
Repeat until the best policy is learned.
Common Algorithms
Q-Learning
SARSA
Deep Q Network (DQN)
Policy Gradient Methods
Actor-Critic Algorithms

Advantages
Learns from experience.
Suitable for sequential decision-making.
Improves performance over time.

***Disadvantages*
**Requires many interactions with the environment.
Computationally expensive.
Training can take a long time.
Applications
Self-Driving Cars
Robotics
Game Playing (Chess, Go, Atari Games)
Traffic Signal Control
Recommendation Systems

Real-Life Example

A robot learns to navigate a room by receiving positive rewards for reaching its destination and penalties for hitting obstacles.

Top comments (0)