Logistic Regression | Mathematics behind Logistic Regression | Probability | Odds | Odds Ratio - P4

preview_player
Показать описание
Mathematics behind Logistic Regression | Probability | Odds | Odds Ratio - P4

Suppose we have a dataset from online XYZ store about the gender of the customer and whether that person bought a particular product or not. We are interested in finding the chances of a customer buying that product, given their gender.
So, What comes to mind when someone poses this question to you?
Probability anyone?
Odds of success?
Odds of failure ?

Conditional probability basically defines the probability of a certain event happening, given that a certain related event is true or has already happened.

The odds ratio is a ratio of odds of success (purchase in this case) for each group (male and female in this case)
Odds of success for a group are defined as the ratio of probability of successes (purchases) to the probability of failures (non-purchases). In our case, the odds of the purchase for the group of males and females can be defined as follows:

Odds of purchase by females = Pf / ( 1 – Pf) , where Pf = Probability of purchase by females
Odds of purchase by males = Pm / ( 1 – Pm) , where Pm = Probability of purchase by males

Code
=====
import pandas as pd

Step 1
print(contingency_table)

Step 2

Step 3
axis=0)

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

1. Data Preprocessing in Machine Learning

2. Confusion Matrix in Machine Learning, ML, AI

3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz

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

5. Drop and Delete Operations in Python Pandas

6. Matrices and Vectors with python

7. Detect Outliers in Machine Learning

8. TimeSeries preprocessing in Machine Learning

9. Handling Missing Values in Machine Learning

10. Dummy Encoding Encoding in Machine Learning

11. Data Visualisation with Python, Seaborn, Matplotlib

12. Feature Scaling in Machine Learning

13. Python 3 basics for Beginner

14. Statistics with Python

15. Sklearn Scikit Learn Machine Learning

16. Python Pandas Dataframe Operations

17. Linear Regression, Supervised Machine Learning

18 Interview Questions on Machine Learning, Artificial Intelligence, Python Pandas and Python Basics

19. Jupyter Notebook Operations

20. Logistic Regression in Machine Learning, Data Science
Рекомендации по теме