8000 [RFC / SLEP?] Enhance scorer (objective) interface and deprecate the `greater_is_better` attr. · Issue #6731 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
[RFC / SLEP?] Enhance scorer (objective) interface and deprecate the greater_is_better attr. #6731
Closed
@raghavrv

Description

@raghavrv

I have a few (probably stupid) suggestions to get this discussion started -

  • Rename make_scorer to make_objective, deprecate the greater_is_better / scorer attributes and instead use loss_func and score_func and document it well to note that loss_func is minimized while score_func will be maximized. (If both are given, throw an error)
make_objective(score_func=None, loss_func=None, needs_proba=False,... **kwargs)
  • In make_objective, when loss functions are passed to score_func instead of loss_func (score_func is set to mean_squared_error), directly throw an error, as we are deprecating and retaining the old make_scorer till 0.20.
  • Replace all _*Scorer* by (_?)*Objective* (_ProbabilityObjective / _PredictionObjective / _ThresholdedObjective)
  • Replace all scoring attribute by objective attribute.
  • objective object returned by make_scorer has a boolean property objective_is_minimizedobjective_is_loss to denote whether the Objective was formed from a loss_func (FalseTrue) or score_func (TrueFalse).

EDIT The objective_is_loss is just for introspection. objective will always return an error score which is always minimized, irrespective of whether it was formed from a loss_func or score_func.

  • Split cross_val_score into cross_val_score and cross_val_loss. Raise deprecation warning if the score_func and loss_func are interchanged til 0.20 and after that throw an error. This is probably superfluous but helps separate demarcate what we mean by loss and score.

Please feel free to point out if this seems stupid.

We need to have this discussion before deciding on multiple metric grid search.

Related issue : #2439

@jnothman @amueller @ogrisel @GaelVaroquaux @MechCoder @vene @larsmans @mblondel @jaquesgrobler @agramfort @TomDLT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0