Skip to content

RandomizedSearchCV - Highest mean_test_score doesn't have rank 1 in rank_test_score in cv_results_ #17267

Closed

Description

@barberogaston

Describe the issue linked to the documentation

While checking the RandomizedSearchCV docs we found out with a partner that the cv_results_ dict shows the following values for mean_test_score and rank_test_score:

{'mean_test_score': [0.81, 0.70, 0.70],
 'rank_test_score': [3, 1, 1]}

This would indicate that rank 3 is the best as its mean_test_score is the highest in the list, and so we could say that the maximum rank of the list rank_test_score is the best one.
However, in practice it turns out that actually rank 1 is the best of them, as seen in the following picture:

Captura de pantalla 2020-05-18 a la(s) 11 45 19

We can also see this here where the report() function ranges over [1; n_top].

Suggest a potential alternative/fix

If this is an error, I would suggest changing the rank_test_score so that the highest mean_test_score has rank 1.

Activity

  1. thomasjpfan commented on May 18, 2020

    @thomasjpfan
    Member

    This is an error in the docs, the rank_test_score should be [1, 2, 2].

    We can also simplify the docstring by changing rank_test_score to [0.81, 0.65, 0.71] and have rank_test_score =[1, 3, 2].

    @barberogaston Would you like to make a PR for this?

  2. barberogaston commented on May 18, 2020

    @barberogaston
    ContributorAuthor

    This is an error in the docs, the rank_test_score should be [1, 2, 2].

    We can also simplify the docstring by changing rank_test_score to [0.81, 0.65, 0.71] and have rank_test_score =[1, 3, 2].

    @barberogaston Would you like to make a PR for this?

    Sure! Thanks for the early reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions