Introduction to Supervised Learning
• Learn how machines make predictions using
labeled data
• Covers Regression, Classification, and Model
Evaluation
• Input Data → Learning Model → Output
Prediction
Simple flow diagram
What is Supervised Learning?
• Supervised Learning uses known (labeled)
data to train models.
• Two main tasks:
• - Regression: Predict numbers (e.g., house
prices)
• - Classification: Predict categories (e.g., spam
vs. not spam)
Linear Regression
• Predicts a continuous value using a straight
line.
• Relationship between input (X) and output (Y)
is linear.
Visual: Scatter plot + best-fit line.
Polynomial Regression
• Like linear regression but fits a curve.
• Helps capture non-linear patterns in data.
Visual: Scatter plot with curved regression line.
Regression Evaluation Metrics
• MAE: Average of absolute errors
• MSE: Average of squared errors
• RMSE: Square root of MSE
• Lower values = better model
Visual: Bar chart comparing MAE, MSE,
RMSE
Logistic Regression
• Used for binary classification (Yes/No)
• Predicts probability using a sigmoid (S) curve
Visual: S-shaped curve graph
K-Nearest Neighbors (KNN)
• Predicts class based on 'k' nearest data points
• Simple and easy to implement
Visual: 2D plot with clusters and a query
point
Decision Trees
• Uses rules to split data based on features
• Each decision forms a branch of the tree
Visual: Tree structure with Yes/No decisions
Random Forests
• Combines many decision trees
• Improves accuracy and reduces overfitting
• Visual: Multiple trees → combined prediction
Visual: Multiple trees → combined
prediction
Classification Metrics
• Accuracy: % of correct predictions
• Precision: Correct positives out of predicted
positives
• Recall: Correct positives out of actual positives
• F1 Score: Balance between precision and
recall
• ROC-AUC: Graph of model performance
Train-Test Split
• Split data into training and testing sets (e.g.,
80/20)
• Helps test model on unseen data
Overfitting vs. Underfitting
• Overfitting: Model memorizes; fails on new
data
• Underfitting: Model too simple; misses
patterns
What Did We Learn?
• Difference between regression and
classification
• How to evaluate models (metrics)
• Preventing underfitting/overfitting
• Importance of splitting and validating data
Thank You!
Cross-Validation
• Splits data into multiple parts to test model
multiple times
• Common: k-fold (e.g., 5-fold or 10-fold)
• Visual: Dataset split into 5 or 10 equal parts
Hyperparameter Tuning with GridSearchCV
• Tries all combinations of parameters to find
best one
• Works with cross-validation
• Example: Testing different 'k' values in KNN