Skip to content

make_scorer needs_threshold makes wrong assumptions #2588

@mblondel

Description

@mblondel

I found two issues with make_scorer's needs_threshold option.

First, it doesn't work if the base estimator is a regressor. Using a regressor is a perfectly valid use case, e.g., if you want do use a regressor but still want to optimize your hyper-parameters against AUC (pointwise ranking with two relevance levels). It does work with Ridge but this is because decision_function and predict are aliases of each others. See also the discussion in issue #1404.

Second, _ThresholdScorer checks that the number of unique values in y_true is 2 but this need not be the case. For example, I can use a regressor and optimize my hyper-parameters against NDCG with more than 2 relevance levels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions