what is Logistic Regression ?
Implementation of Logistic Regression
Logistic regression is the appropriate regression analysis to conduct when the dependent variable is binary.
Basically logistic regression is working on this formula :
Now the question is there is already linear regression available then why we need logistic regression?
Logistic regression vs linear regression :
Lets understand the concept of why we need logistic regression. consider below graph and fit line using leaner regression.
so you can clearly saw that it's a very inappropriate way to fit line and our ml model accuracy look bad.
Lets now fit the line using Logistic regression
Logistic regression in python :
Now lets do some coding
We will predict the person have insurance or not on the basis of his/her age.
First we import the library
Lets do train test split
You can download data set by click here
Comments
Post a Comment