I'm trying to run gridsearch with LogisticRegression, and get
ValueError: Can't handle mix of continuous and binary
I've traced this error to metrics.accuracy_score
. Apparently the prediction doesn't go so well, and while the y_true is continuous (as is the rest of the data), y_pred is all zeros and is thus classified as binary.
Thanks
Somewhat confusingly logistic regression is actually a classification algorithm (see http://scikit-learn.org/stable/modules/linear_model.html#logistic-regression). As such the target ("y_true") data that you feed it should be binary. If you are actually trying to solve a regression problem you should choose a different algorithm, e.g. LinearRegression, SVR, RandomForestRegressor, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With