get_corpus_scorer#
- scikitplot.corpus.get_corpus_scorer(name, *, response_method='predict', id_getter=None, on_degraded='raise', **kwargs)[source]#
Return a new scorer for a metric name.
- Parameters:
- namestr
A name from
get_corpus_scorer_names; ranking names take an optional cutoff,"recall@10". A ranking name without a cutoff uses the whole ranking.- response_method{“predict”, “search”}, default=”predict”
See
make_corpus_scorer.- id_gettercallable or None, default=None
See
make_corpus_scorer.- on_degraded{“raise”, “ignore”}, default=”raise”
See
make_corpus_scorer.- **kwargsdict
Further arguments of the metric, such as
zero_division.
- Returns:
- scorer
A new instance on every call, as
sklearn.metrics.get_scorer.
- Raises:
- ValueError
For an unknown name, or
kgiven both in the name and as a keyword.
- Parameters:
- Return type:
Examples
>>> get_corpus_scorer("ndcg@10", response_method="search") make_corpus_scorer(ndcg_at_k, response_method='search', k=10)