Unit 4 – Introduction to
Machine Learning
Overview, Algorithms, and Evaluation
What is Machine Learning?
• Definition: ML is a subset of AI where
systems learn patterns from data to make
decisions or predictions.
• Key idea: Systems improve automatically with
experience.
• Example: Email spam detection,
recommendation systems.
Types of Machine Learning
• Supervised Learning: Models trained with
labeled data.
• Unsupervised Learning: Models find patterns
in unlabeled data.
• Reinforcement Learning: (Optional mention)
Models learn via rewards/punishments.
Supervised Learning
• Definition: Learns from input-output pairs.
• Goal: Predict outcomes for new data.
• Examples: Spam detection, loan approval.
• Key tasks:
– Classification: Predict categories
– Regression: Predict continuous values
Unsupervised Learning
• Definition: Learns patterns without labeled
outputs.
• Goal: Discover hidden structure in data.
• Examples: Customer segmentation, anomaly
detection.
• Common methods: Clustering, dimensionality
reduction.
Classification Overview
• Definition: Assigns data to discrete categories.
• Examples:
– Email: Spam or Not Spam
– Medical: Disease vs. Healthy
• Common algorithms: Logistic Regression,
Decision Trees, Random Forest.
Regression Overview
• Definition: Predicts continuous numerical
values.
• Examples:
– House price prediction
– Stock price forecasting
• Common algorithms: Linear Regression,
Ridge, Lasso.
Logistic Regression
• Purpose: Used for binary classification.
• Concept: Estimates probability of class
membership using the sigmoid function.
• Formula: P(y=1)=11+e−zP(y=1) = frac{1}
{1+e^{-z}}P(y=1)=1+e−z1​
• Pros & Cons: Simple and interpretable,
struggles with complex boundaries.
Decision Trees
• Purpose: Can be used for classification and
regression.
• Concept: Splits data into branches based on
feature thresholds.
• Advantages: Easy to interpret, handles non-
linear relationships.
• Visual: Include a simple tree diagram.
Linear Regression
• Purpose: Predicts a continuous dependent
variable.
• Formula: y=β0+β1x1+ +
⋯ βnxn+ϵy = beta_0 + 
beta_1 x_1 + dots + beta_n x_n + epsilony=β0​
+β1​
x1​
+ +
⋯ βn​
xn​
+ϵ
• Assumptions: Linearity, independence,
homoscedasticity.
• Example: Predicting salary based on experience.
Ridge Regression
• Purpose: Linear regression with L2
regularization.
• Formula: Minimize ∑(y−y^)2+λ∑βi2sum(y - 
hat{y})^2 + lambda sum beta_i^2∑(y−y^​
)2+λ∑βi2​
• Key point: Reduces overfitting by shrinking
coefficients.
Lasso Regression
• Purpose: Linear regression with L1
regularization.
• Formula: Minimize ∑(y−y^)2+λ∑ β
∣ i sum(y
∣
- hat{y})^2 + lambda sum |beta_i|∑(y−y^​
)2+λ∑ β
∣ i​
∣
• Key point: Can perform feature selection by
setting some coefficients to zero.
Model Evaluation Metrics
• Confusion Matrix: True Positive, True
Negative, False Positive, False Negative.
• Metrics derived:
– Accuracy: (TP+TN)/Total
– Precision: TP/(TP+FP)
– Recall: TP/(TP+FN)
– F1-score: Harmonic mean of Precision and Recall.
Choosing the Right Algorithm
• Factors to consider:
– Type of problem (Classification vs Regression)
– Data size & quality
– Model interpretability
– Computational resources
Summary & Key Takeaways
• ML helps systems learn from data to predict or classify.
• Supervised vs Unsupervised learning: Know the
difference.
• Important algorithms: Logistic Regression, Decision
Trees, Linear Regression, Ridge, Lasso.
• Evaluation metrics ensure models perform well in real
scenarios.
• Encourage practice: “Try building models with real
datasets!”
Thank You

Unit 4_Introduction to machine Learning.pptx

  • 1.
    Unit 4 –Introduction to Machine Learning Overview, Algorithms, and Evaluation
  • 2.
    What is MachineLearning? • Definition: ML is a subset of AI where systems learn patterns from data to make decisions or predictions. • Key idea: Systems improve automatically with experience. • Example: Email spam detection, recommendation systems.
  • 3.
    Types of MachineLearning • Supervised Learning: Models trained with labeled data. • Unsupervised Learning: Models find patterns in unlabeled data. • Reinforcement Learning: (Optional mention) Models learn via rewards/punishments.
  • 4.
    Supervised Learning • Definition:Learns from input-output pairs. • Goal: Predict outcomes for new data. • Examples: Spam detection, loan approval. • Key tasks: – Classification: Predict categories – Regression: Predict continuous values
  • 5.
    Unsupervised Learning • Definition:Learns patterns without labeled outputs. • Goal: Discover hidden structure in data. • Examples: Customer segmentation, anomaly detection. • Common methods: Clustering, dimensionality reduction.
  • 6.
    Classification Overview • Definition:Assigns data to discrete categories. • Examples: – Email: Spam or Not Spam – Medical: Disease vs. Healthy • Common algorithms: Logistic Regression, Decision Trees, Random Forest.
  • 7.
    Regression Overview • Definition:Predicts continuous numerical values. • Examples: – House price prediction – Stock price forecasting • Common algorithms: Linear Regression, Ridge, Lasso.
  • 8.
    Logistic Regression • Purpose:Used for binary classification. • Concept: Estimates probability of class membership using the sigmoid function. • Formula: P(y=1)=11+e−zP(y=1) = frac{1} {1+e^{-z}}P(y=1)=1+e−z1​ • Pros & Cons: Simple and interpretable, struggles with complex boundaries.
  • 9.
    Decision Trees • Purpose:Can be used for classification and regression. • Concept: Splits data into branches based on feature thresholds. • Advantages: Easy to interpret, handles non- linear relationships. • Visual: Include a simple tree diagram.
  • 10.
    Linear Regression • Purpose:Predicts a continuous dependent variable. • Formula: y=β0+β1x1+ + ⋯ βnxn+ϵy = beta_0 + beta_1 x_1 + dots + beta_n x_n + epsilony=β0​ +β1​ x1​ + + ⋯ βn​ xn​ +ϵ • Assumptions: Linearity, independence, homoscedasticity. • Example: Predicting salary based on experience.
  • 11.
    Ridge Regression • Purpose:Linear regression with L2 regularization. • Formula: Minimize ∑(y−y^)2+λ∑βi2sum(y - hat{y})^2 + lambda sum beta_i^2∑(y−y^​ )2+λ∑βi2​ • Key point: Reduces overfitting by shrinking coefficients.
  • 12.
    Lasso Regression • Purpose:Linear regression with L1 regularization. • Formula: Minimize ∑(y−y^)2+λ∑ β ∣ i sum(y ∣ - hat{y})^2 + lambda sum |beta_i|∑(y−y^​ )2+λ∑ β ∣ i​ ∣ • Key point: Can perform feature selection by setting some coefficients to zero.
  • 13.
    Model Evaluation Metrics •Confusion Matrix: True Positive, True Negative, False Positive, False Negative. • Metrics derived: – Accuracy: (TP+TN)/Total – Precision: TP/(TP+FP) – Recall: TP/(TP+FN) – F1-score: Harmonic mean of Precision and Recall.
  • 14.
    Choosing the RightAlgorithm • Factors to consider: – Type of problem (Classification vs Regression) – Data size & quality – Model interpretability – Computational resources
  • 15.
    Summary & KeyTakeaways • ML helps systems learn from data to predict or classify. • Supervised vs Unsupervised learning: Know the difference. • Important algorithms: Logistic Regression, Decision Trees, Linear Regression, Ridge, Lasso. • Evaluation metrics ensure models perform well in real scenarios. • Encourage practice: “Try building models with real datasets!”
  • 16.