5/17/26, 3:44 PM Supervised Machine Learning - GeeksforGeeks
Courses
Search... Tutorials Sign In
Interview Prep
Python for Machine Learning Machine Learning with R Machine Learning Algorithms EDA Math for Machine Learning Machine Learning Int
Supervised Machine Learning
Last Updated : 9 May, 2026
Supervised learning is a type of machine learning where a model learns from labelled data, meaning each
input has a correct output. The model compares its predictions with actual results and improves over time
to increase accuracy.
Supervised Machine Learning
Its main features are:
Each input has a known output
Adjusts itself to reduce prediction errors
Make accurate predictions on new data
For example it recognizing handwritten digits from trained data
Types of Supervised Learning
Now, Supervised learning can be applied to two main types of problems:
Classification: Where the output is a categorical variable (e.g., spam vs. non-spam emails, yes vs. no).
Regression: Where the output is a continuous variable (e.g., predicting house prices, stock prices).
[Link] w w .[Link]/machine-learning/supervised-machine-learning/ 1/6
5/17/26, 3:44 PM Supervised Machine Learning - GeeksforGeeks
Types of Supervised Learning
Let's first understand the classification and regression data through the table below:
Sample
Both the above figures have labelled data set as follows:
Figure A: It is a dataset of a shopping store that is useful in predicting whether a customer will purchase a
particular product under consideration or not based on his/her gender, age and salary.
Input: Gender, Age, Salary
Output: Purchased i.e. 0 or 1; 1 means yes the customer will purchase and 0 means that the customer
won't purchase it.
Figure B: It is a Meteorological dataset that serves the purpose of predicting wind speed based on different
parameters.
Input: Dew Point, Temperature, Pressure, Relative Humidity, Wind Direction
Output: Wind Speed
Working of Supervised Machine Learning
The working of supervised machine learning follows these key steps:
1. Collect Labeled Data
Gather a dataset where each input has a known correct output (label).
Example: Images of handwritten digits with their actual numbers as labels.
[Link] w w .[Link]/machine-learning/supervised-machine-learning/ 2/6
5/17/26, 3:44 PM Supervised Machine Learning - GeeksforGeeks
2. Split the Dataset
Divide the data into training data (about 80%) and testing data (about 20%).
The model will learn from the training data and be evaluated on the testing data.
3. Train the Model
Feed the training data (inputs and their labels) to a suitable supervised learning algorithm (like Decision
Trees, SVM or Linear Regression).
The model tries to find patterns that map inputs to correct outputs.
4. Validate and Test the Model
Evaluate the model using testing data it has never seen before.
The model predicts outputs and these predictions are compared with the actual labels to calculate
accuracy or error.
5. Deploy and Predict on New Data
Once the model performs well, it can be used to predict outputs for completely new, unseen data.
Supervised Machine Learning Algorithms
Supervised learning includes different types of algorithms used to predict outputs based on labeled data.
Each algorithm is designed for specific tasks like prediction or classification.
Linear Regression: Used to predict continuous values (e.g., price, temperature). It is simple and widely
used.
Logistic Regression: Logistic regression is a type of supervised learning classification algorithm that is
used to predict a binary output variable.
Decision Trees: Uses a tree-like structure where each node represents a decision and each leaf
represents an outcome.
Random Forests: Combines multiple decision trees to improve accuracy and reduce overfitting.
Support Vector Machine(SVM): Separates data into classes using a boundary (hyperplane). Support
vectors help define this boundary.
K-Nearest Neighbors: Predicts based on the closest data points. Results depend on the value of k and
distance measure.
Gradient Boosting: Builds models step-by-step by correcting errors of previous models, creating a
strong model.
Naive Bayes Algorithm: Based on probability and Bayes’ Theorem, assuming features are independent of
each other.
Examples
Fraud Detection in Banking: Uses labeled transaction data to identify and predict fraudulent activities.
Parkinson Disease Prediction: Analyzes medical data such as voice recordings, motor symptoms, and
clinical measurements to identify patterns and predict whether a patient has disease or not.
[Link] w w .[Link]/machine-learning/supervised-machine-learning/ 3/6
5/17/26, 3:44 PM Supervised Machine Learning - GeeksforGeeks
Customer Churn Prediction: Uses historical customer data to predict whether a customer will leave a
service.
Cancer cell classification: Implements supervised learning for cancer cells based on their features and
identifying them if they are ‘malignant’ or ‘benign.
Stock Price Prediction: Uses past data to predict stock trends and support investment decisions.
Advantages
Easy to understand and implement as it learns from labeled data.
Provides high accuracy when sufficient labeled data is available.
Works for both classification (spam detection, disease prediction) and regression (price forecasting).
Can generalize well to unseen data with proper training and diverse datasets.
Widely used in applications like speech recognition, medical diagnosis, sentiment analysis and fraud
detection.
Disadvantages
Requires large amounts of labeled data, which is expensive and time-consuming to prepare.
Can be biased if the training data is unbalanced, leading to unfair or inaccurate predictions.
May overfit the training data instead of learning general patterns, especially with small datasets.
Performance can drop when applied to data that is very different from the training data.
Not easily scalable for problems with a very large number of labels, such as in natural language tasks.
Supervised Machine Learning Visit Course
Suggested Quiz 10 Questions
In supervised machine learning, what is the primary purpose of using labeled data during the training phase?
A To introduce randomness in the model
B To allow the model to learn the relationship between inputs and outputs
[Link] w w .[Link]/machine-learning/supervised-machine-learning/ 4/6
5/17/26, 3:44 PM Supervised Machine Learning - GeeksforGeeks
C To increase the complexity of the model
D To reduce the amount of data required for training
Login to View Explanation 1/10 < Previous Next >
Comment M mohit … 167
Article Tags: Machine Learning
Explore
Machine Learning Basics
Python for Machine Learning
Feature Engineering
Supervised Learning
Unsupervised Learning
Model Evaluation and Tuning
Advanced Techniques
Machine Learning Practice
Machine Learning Courses
Company Explore Tutorials Courses Videos Preparation
About Us POTD Programming ML and Data DSA Corner
Corporate & Communications Address: Legal Job-A- Languages Science Python Interview
Privacy Thon DSA DSA and Java Corner
A-143, 7th Floor, Sovereign Corporate
Tower, Sector- 136, Noida, Uttar Policy Blogs Web Placements C++ Aptitude
Pradesh (201305) Contact Us Nation Technology Web Web Puzzles
Advertise Skill Up AI, ML & Data Development Development GfG 160
Registered Address:
with us Science Programming Data Science System
K 061, Tower K, Gulshan Vivante GFG DevOps Languages CS Subjects Design
Apartment, Sector 137, Noida,
Corporate CS Core DevOps &
Gautam Buddh Nagar, Uttar Pradesh,
201305 Solution Subjects Cloud
Campus Interview GATE
Training Preparation Trending
Program Software and Technologies
Tools
[Link] w w .[Link]/machine-learning/supervised-machine-learning/ 5/6
5/17/26, 3:44 PM Supervised Machine Learning - GeeksforGeeks
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
[Link] w w .[Link]/machine-learning/supervised-machine-learning/ 6/6