Ds Lect 14
Ds Lect 14
Supervised Learning
Overview
Instructor:
Rabia Tariq
Lecturer, Department of Computer Science
Email: [email protected]
Course Topics
Regression Algorithm
Classification Algorithm
•Machine Learning algorithms are computational methods that allow systems to learn patterns from data and make
predictions or decisions without being explicitly programmed.
Unsupervised Learning: Identifies patterns in unlabeled data (e.g., clustering, dimensionality reduction).
Supervised Learning: Uses labeled data for training (e.g., regression, classification).
Reinforcement Learning: Learns from actions and rewards (e.g., game-playing AI, robotics).
Continuous Data
•Continuous data consists of numerical values that can take any value within a range.
•These values are measurable and often represented as real numbers.
•Used in Regression problems.
Example: Predicting house prices based on area and location.
Algorithm Example: Linear Regression, Decision Trees (for regression).
•Non-continuous data, also known as categorical or discrete data, consists of distinct labels or categories.
•Algorithms used for this type of data generally fall under classification models.
1. Decision Tree (Classification)
Decision Trees are used for both regression and classification, but in the case of categorical data, they help classify
instances into discrete labels.
How It Works?
The dataset is split based on feature values using impurity measures like Gini Index or Entropy (used in ID3 Algorithm).
Nodes represent features, and branches represent decisions leading to final class labels at the leaf nodes.
Example: Classifying Emails as Spam or Not Spam
Feature: Contains “discount” in the subject line? → Yes/No
If Yes → More likely Spam
If No → Move to next decision (e.g., Contains attachment? Yes/No)
Comparison of Algorithms for Continuous vs. Non-Continuous Data
End