Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the What you really need to know section for the big picture.

julearn.scoring.register_scorer

julearn.scoring.register_scorer(scorer_name, scorer, overwrite=None)

Register a scorer, so that it can be accessed by name.

Parameters:
  • scorer_name (str) – name of the scorer you want to register

  • scorer (_Scorer) – Callable object that returns a scalar score; greater is better. Will be called using (estimator, X, y).

  • overwrite (bool | None, default: None) – decides whether overwrite should be allowed. Options are:

Raises:

ValueError – if overwrite is set to False and the scorer already exists.

Warns:
UserWarning

if overwrite is set to None and the scorer already exists.

Examples using julearn.scoring.register_scorer

Custom Scoring Function for Regression

Custom Scoring Function for Regression