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

Skip to content

RFECV docstring does not state how the cv_results_ attribute is ordered by #28580

Closed
@ArturoSbr

Description

@ArturoSbr

Describe the issue linked to the documentation

This StackOverflow post has more details regarding this small issue.

In essence, I noticed that the documentation for RFECV does not state how the cv_results_ attribute is ordered by.

Given that the process is recursive, some users (myself included) may assume that the dictionary is sorted in descending order (i.e., the first element corresponds to the models that used ALL features, then one step less, then two steps less, etc.). However, it seems to me that the dictionary is sorted in ascending order.

Suggest a potential alternative/fix

From my perspective, the easiest fix would be to add a few lines to the docstring. Something along the lines of:

This dictionary is sorted by the number of features in ascending order (i.e., the first element represents the models that use the least number of features, while the last element represents the models that use all available features).

As an alternative, the resulting dictionary could have an additional key named n_features (or something along those lines) that states how many features each element in the dictionary represents.

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