Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ValueError in scikit-learn/examples/model_selection/grid_search_digits.py #4736

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

Closed
moqri opened this issue May 18, 2015 · 5 comments
Closed

Comments

@moqri
Copy link

moqri commented May 18, 2015

When running with Spyder using Python 2.7, returns this error:

ValueError: 'precision_weighted' is not a valid scoring value. Valid options are ['accuracy', 'adjusted_rand_score', 'average_precision', 'f1', 'log_loss', 'mean_absolute_error', 'mean_squared_error', 'precision', 'r2', 'recall', 'roc_auc']

@moqri moqri changed the title Value error in scikit-learn/examples/model_selection/grid_search_digits.py ValueError in scikit-learn/examples/model_selection/grid_search_digits.py May 18, 2015
@amueller
Copy link
Member

Could it be that the version of scikit-learn from which you got the example is not the one which you have installed?

@jnothman
Copy link
Member

Not replicated

@tobigithub
Copy link

@amueller,
correct, probably happens quite often, its not readily visible for new users that running examples from older versions of scikit-learn will lead to such errors. Especially when a google search turns up old example versions first.

The code for the older demos looks completely legit, however throws errors during execution. A better way would be to comment on top of each of the examples for which scikit-learn version number this is designed. Or insert in the code comment, only certified for version 0.XX.0 of scikit-learn.

Example:
0.18.1 (is now stable but has no version number in URL)
http://scikit-learn.org/stable/auto_examples/model_selection/grid_search_digits.html

0.15 (older version) turns up during google search
http://scikit-learn.org/0.15/auto_examples/grid_search_digits.html

Error when running 0.15 example in 0.18

precision_recall_fscore_support
    "choose another average setting." % y_type)

ValueError: Target is multiclass but average='binary'. Please choose another average setting.

@GaelVaroquaux
Copy link
Member

GaelVaroquaux commented May 30, 2017 via email

@jnothman
Copy link
Member

jnothman commented Jun 1, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants