-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
TypeError when using accuracy_score as scoring argument in LogisticRegressionCV #8333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please offer a PR providing consistency with grid search |
Whats PR? Ok got it Pull Request. :p |
pull request, sorry
…On 13 Feb 2017 4:04 pm, "Vivek Kumar" ***@***.***> wrote:
Whats PR?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#8333 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz6-z2xGQ7NUqfswxsA0yquajQDvHnks5rb-RUgaJpZM4L9C9L>
.
|
Yes, I have done a pull request above to update the documentation |
Updated documentation for scoring parameter of LogisticRegressionCV to make it consistent with GridSearchCV documentation. Fixes #8333
Yes, sure. Actually I am new to all this. I'll definitely keep this in mind. |
Updated documentation for scoring parameter of LogisticRegressionCV to make it consistent with GridSearchCV documentation. Fixes scikit-learn#8333
Updated documentation for scoring parameter of LogisticRegressionCV to make it consistent with GridSearchCV documentation. Fixes scikit-learn#8333
Updated documentation for scoring parameter of LogisticRegressionCV to make it consistent with GridSearchCV documentation. Fixes scikit-learn#8333
Updated documentation for scoring parameter of LogisticRegressionCV to make it consistent with GridSearchCV documentation. Fixes scikit-learn#8333
Updated documentation for scoring parameter of LogisticRegressionCV to make it consistent with GridSearchCV documentation. Fixes scikit-learn#8333
Expected array-like (array or non-string sequence), got None That error i am getting when executing dt_grid_estimator.score(X_train). Kindly let us help where is the gap. |
@soumyawizard Anyways for general usage related tasks, please first submit it on Stack-Overflow instead:
|
Updated documentation for scoring parameter of LogisticRegressionCV to make it consistent with GridSearchCV documentation. Fixes scikit-learn#8333
Description
TypeError: Expected sequence or array-like, got estimator
Steps/Code to Reproduce
Example:
import numpy as np
from sklearn.metrics import accuracy_score
from sklearn.linear_model import LogisticRegressionCV
X=np.random.rand(50,5)
y=np.random.randint(2, size=50)
logmodel = LogisticRegressionCV(Cs =1, dual=False , scoring = accuracy_score, penalty = 'l2')
logmodel.fit(X, y)
Expected Results
No error is thrown.
Actual Results
TypeError: Expected sequence or array-like, got estimator
Observation:
Passing 'accuracy' or make_scorer(accuracy_score) works correctly. If this is the intended behaviour it should be mentioned in documentation.
Documentation says "Scoring function to use as cross-validation criteria. For a list of scoring functions that can be used, look at sklearn.metrics. The default scoring option used is accuracy_score.". So user may be tempted to pass accuracy_score as argument which throws the error.
Suggestion
If it is the intended behaviour, then please make the documentation same as GridSearchCV, so that the confusion may be avoided
"A string (see model evaluation documentation) or a scorer callable object / function with signature scorer(estimator, X, y). If None, the score method of the estimator is used"
Versions
Linux-3.16.0-77-generic-x86_64-with-Ubuntu-14.04-trusty
('Python', '2.7.6 (default, Oct 26 2016, 20:30:19) \n[GCC 4.8.4]')
('NumPy', '1.12.0')
('SciPy', '0.18.1')
('Scikit-Learn', '0.18.1')
The text was updated successfully, but these errors were encountered: