Logistic Regression | How to derive Logistic Regression | Deriving Logistic Regression Equation - P5
YouTube Viewers YouTube Viewers
7.12K subscribers
7,642 views
0

 Published On Premiered Dec 31, 2020

Logistic Regression | How to derive Logistic Regression | Deriving Logistic Regression Equation - P5

Step 1.
We know the equation of simple linear regression is Y = m*X + c
X is a continuous / dummy variable (categorical) whose range can be from
–inf to +inf
The output variable Y is a continuous variable whose range is also from -inf to +inf
So, the ranges of variable on both the sides of the equation matched.

Step 2
As the outcome variable is binary in case of logistic regression, the Y variable can take only discrete values, 0 or 1.
However, predicting 0 or 1 using an equation similar to linear regression is not possible.
So, what if we try to predict the probabilities associated with the two events rather than the binary outcomes? Predicting the probabilities will be feasible as their range spans from 0 to 1.

Step 3
Earlier, we calculated the conditional probability of a customer purchasing a particular product, given he is male or female. These are the probabilities we are thinking of predicting.
In case there is one predictor variable, so it was very easy. However, as the number of predictor variables increase, these conditional probabilities will become more and more difficult to calculate. However, anyways, predicting probability is a better choice than predicting 0 or 1. Hence, for logistic regression, something like the below equation will be better:
P = m* X + c

Step 4
Even with this new equation, the problem of non-matching ranges on both the sides of the equation persists.
The P ranges from 0 to 1, while X ranges from –inf to +inf.
What if we replace the P with odds, that is, P/1-P. We have seen earlier that the odds can range from 0 to +infinity. So, the proposed equation becomes:
P / ( 1 – P) = m*X + c

Step 5
Still the LHS of the equation ranges from 0 to +infinity, while the RHS ranges from –infinity to +infinity. How to get rid of this? We need to transform one side of the equation so that the ranges on both the sides match.
What if we take a natural logarithm of the odds (LHS of the equation)? Then, the range on the LHS also becomes –infinity to +infinity.
So, the final equation becomes as follows:
Log (P / 1 – P) = m* X + c
The term Loge(Odds) is called Logit.


All Playlist of this youtube channel
==============================

1. Data Preprocessing in Machine Learning
   • Data Preprocessing in Machine Learnin...  

2. Confusion Matrix in Machine Learning, ML, AI
   • Confusion Matrix in Machine Learning,...  

3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
   • Anaconda | Python Installation | Spyd...  

4. Cross Validation, Sampling, train test split in Machine Learning
   • Cross Validation | Sampling | train t...  

5. Drop and Delete Operations in Python Pandas
   • Drop and Delete Operations in Python ...  

6. Matrices and Vectors with python
   • Matrices and Vectors with python  

7. Detect Outliers in Machine Learning
   • Detect Outliers in Machine Learning  

8. TimeSeries preprocessing in Machine Learning
   • TimeSeries preprocessing in Machine L...  

9. Handling Missing Values in Machine Learning
   • Handling Missing Values in Machine Le...  

10. Dummy Encoding Encoding in Machine Learning
   • Label Encoding, One hot Encoding, Dum...  

11. Data Visualisation with Python, Seaborn, Matplotlib
   • Data Visualisation with Python, Matpl...  

12. Feature Scaling in Machine Learning
   • Feature Scaling in Machine Learning  

13. Python 3 basics for Beginner
   • Python | Python 3 Basics | Python for...  

14. Statistics with Python
   • Statistics with Python  

15. Sklearn Scikit Learn Machine Learning
   • Sklearn Scikit Learn Machine Learning  

16. Python Pandas Dataframe Operations
   • Python Pandas Dataframe Operations  

17. Linear Regression, Supervised Machine Learning
   • Linear Regression | Supervised Machin...  

18 Interview Questions on Machine Learning, Artificial Intelligence, Python Pandas and Python Basics
   • Interview Question for Machine Learni...  

19. Jupyter Notebook Operations
   • Jupyter and Spyder Notebook Operation...  

20. Logistic Regression in Machine Learning, Data Science
   • Logistic Regression | Classification ...  

show more

Share/Embed