Logistic Regression

```

Hi, for The logistic regression model in (Building a Machine Learning Model with Python) shouldn’t the coef be multiplied by the x component → which in this case would be purchase and not min_on_site??
This is copied from and referring to the guide in the passage portion and it pertains to the way to set up Q1 too.

from sklearn.linear_model import LogisticRegressionmodel = LogisticRegression()model.fit(purchase, min_on_site)


Next, just like linear regression, we can use the right-hand side of our regression equation to make predictions for each of our original datapoints as follows:

log_odds = model.intercept_ + model.coef_ * min_on_site

print(log_odds)

Hi,

In the example model you mentioned, min_on_site is the predictor variable and purchase is the target variable i.e. the time spent on the website by a visitor is used as a feature to predict whether or not they will make a purchase.

Therefore, the model is trained using min_on_site as the x variable and purchase as the y (target) variable.