Context.get_single_scorer#

Context.get_single_scorer(scorer: Optional[Union[Mapping[str, Union[str, Callable]], List[str]]] = None, use_avg_defaults=True) DeepcheckScorer[source]#

Return initialized & validated scorer if provided or a default scorer otherwise.

Parameters
scorert.Union[t.Mapping[str, t.Union[str, t.Callable]], t.List[str], None], default: None

List of scorers to use. If None, use default scorers. Scorers can be supplied as a list of scorer names or as a dictionary of names and functions.

use_avg_defaultsbool, default: True

If no scorers were provided, for classification, determines whether to use default scorers that return an averaged metric, or default scorers that return a metric per class.

Returns
——-
List[DeepcheckScorer]

An initialized & validated scorer.