...

/

Logistic Regression Steps: 5 to 7

Logistic Regression Steps: 5 to 7

This lesson will go over steps 5-7 of logistic regression implementation.

5) Remove and fill missing values

Let’s now inspect the data frame for missing values.

Press + to interact
#5. Remove and fill missing values
print(df.isnull().sum())

The output shows that four of the thirty six variables contain missing values: these four variables and their correlation to the y (dependent) variable (State_successful) are summarized in the table below.

Press + to interact
#Code for obtaining correlation coefficients
df['State_successful'].corr(df['Facebook Friends'].astype(float))
df['State_successful'].corr(df['Creator - # Projects Backed'].astype(float))
df['State_successful'].corr(df['# Videos'].astype(float))
df['State_successful'].corr(df['# Words (Risks and Challenges)'].astype(float))

Facebook Friends and Creator - # Projects Backed variables have many missing ...