I am going through the Customer Analystic section. In this section, logistic regression is conduted to fit the model with our X or price and our Y or incidence.
The codes provided by the course are as follow:
# We create a Logistic Regression model using sk learn. Then we fit the model with our X or price and our Y or incidence.
model_purchase = LogisticRegression(solver = ‘sag’)
I try to do scatter plot on X,Y to see what happen. My codes following the above codes are
However, I found that plot is not like a sigmoid function as we commonly have in Logistic Regression. ( it looks like a pair of parrell lines)
Confused.. is my scatter plot making sense here? do we expect to see a sigmoid-like scatter plot?
thanks for reaching out!
When you create a scatter plot on X and Y, you’re creating a scatter plot on those two variables X and Y. In our case:
Y is the incidence column which is binary(contains 0s and 1s)
X is the average price.
A scatter plot shows each point with coordinates X and Y on a 2D plane.So, the pair of parallel lines you’re seeing are for the 0s and 1s from the X variable. And a scatter plot of X and Y should look exactly like that.
A sigmoid function, on the other hand, is something different. The sigmoid function is the logistic function used by the Logistic Regression to estimate the class probabilities.