I'm trying to run a logistic regression model from sklearn.
But when I run model.fit()
, it asks 3 parameters (self, X, and y)
. So what is this "self" parameter actually, and how can I run the model properly?
Here's my code:
from sklearn.linear_model import LogisticRegression
logR = LogisticRegression.fit(X = X_train, y= y_train)
and here's the error message:
TypeError Traceback (most recent call last)
<ipython-input-112-630096e6bf16> in <module>
1 from sklearn.linear_model import LogisticRegression
----> 2 logR = LogisticRegression.fit(X = X_train, y= y_train)
TypeError: fit() missing 1 required positional argument: 'self'