Introduction to Machine Learning
Ch2_Lec3_ Linear Regression and Gradient Descent
1
By Kassahun Tamir
Outline
Classification
Logistic Regression Model
Interpretation of hypothesis output
Decision Boundary
Cost Function
Logistic Regression Cost Function
By Kassahun Tamir 2
Classification
Logistic regression is a type of regression analysis used for predicting
the outcome of a dependent variable based on one or more
independent variables. It models the probability that a given input point
belongs to a certain class.
✗ Email: Spam / Not Spam?
✗ Online Transactions: Fraudulent (Yes/No)?
✗ Tumor: Malignant / Benign?
0: “Negative Class” (e.g. benign tumor)
1: “Positive Class” (e.g. malignant tumor)
By Kassahun Tamir 3
Logistic Regression Model
The logistic function, also known as the sigmoid function, is central to
logistic regression. It helps transform the linear output of a regression
model into a probability value that lies between 0 and 1. This is
particularly useful for binary classification problems.
We want:
This is Sigmoid Function/Logistic Function.
By Kassahun Tamir 4
Interpretation of Hypothesis Output
= the estimated probability that y = 1 on input x
Example: If
Tell patient that 70% chance of tumor being malignant
By Kassahun Tamir 5
Decision Boundary
By Kassahun Tamir 6
Decision Boundary
By Kassahun Tamir 7
Decision Boundary
By Kassahun Tamir 8
Decision Boundary
By Kassahun Tamir 9
Cost Function
By Kassahun Tamir 10
Cost Function
By Kassahun Tamir 11
Logistic Regression Cost Function
By Kassahun Tamir 12
Logistic Regression Cost Function
By Kassahun Tamir 13
Logistic Regression Cost Function
By Kassahun Tamir 14
Questions?
By Kassahun Tamir 15