Issue
I just started learning sklearn.
I had trained a LogisticRegression model using sklearn.
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
x_train , x_test , y_train , y_test = train_test_split(new_df_dummies , df.left ,
test_size=0.2,train_size=0.8)
model = LogisticRegression
but when I try to train the model using :
model.fit(x_train , y_train)
It gives error :
fit() missing 1 required positional argument: 'y'
Solution
You should write
model = LogisticRegression()
instead of LogisticRegression
(i.e. add parentheses).
Answered By - Noorulain Islam
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.