It’s a type of machine learning where the model learns from labeled data.
Labeled data means each input has a known correct output.
Think of it like a teacher giving you questions with answers, and you learn the pattern.
Example Dataset:
| Hours Studied | Passed Exam |
| ------------- | ----------- |
| 1 | No |
| 2 | No |
| 3 | Yes |
| 4 | Yes |
The model tries to learn the relation between “Hours Studied” and “Passed Exam.”
How It Works (Step-by-Step):
1. You collect labeled data (input features + correct output)
2. Split the data into training (80%) and testing (20%)
3. Choose a model (e.g., Linear Regression, Decision Tree, SVM)
4. Train the model to learn patterns
5. Evaluate performance using metrics like accuracy or MSE
Real-World Examples:
⦁ Spam Detection
Input: Email content
Output: Spam or Not Spam
⦁ House Price Prediction
Input: Size, location, rooms
Output: Price
⦁ Loan Approval
Input: Salary, credit score, job type
Output: Approve / Reject
⦁ Image Classification (e.g., identifying cats in photos)
Input: Pixel data
Output: Object category
⦁ Fraud Detection
Input: Transaction details
Output: Fraudulent or Legitimate
Python Code (Simple Classification):
from sklearn.tree import DecisionTreeClassifier
X = [,,,]
y = ['No', 'No', 'Yes', 'Yes']
model = DecisionTreeClassifier()
model.fit(X, y)
print(model.predict([[2.5]])) # Output: 'Yes'
Summary:
⦁ Input + Output = Supervised
⦁ Goal: Learn mapping from X → Y
⦁ Used in most real-world ML systems
Double Tap ♥️ For More