exact_match_score#
- scikitplot.corpus.exact_match_score(y_true, y_pred, *, normalize='squad', sample_weight=None, average='mean')[source]#
Fraction of predicted answers equal to a reference after normalisation.
- Parameters:
- y_truesequence or mapping
Reference answers per item: a
stror a sequence ofstr.- y_predsequence or mapping
Predicted answer per item (
str), aligned withy_true.- normalize{“squad”, “basic”, None}, default=”squad”
Normalisation of both sides.
- sample_weightarray-like of shape (n_items,), default=None
Per-item weights of the mean.
- average{“mean”, None}, default=”mean”
Nonereturns per-item values.
- Returns:
- float or numpy.ndarray
- Raises:
- TypeError, ValueError
For malformed inputs; the message names the item.
- Parameters:
- Return type:
Examples
>>> exact_match_score( ... ["The Eiffel Tower", ["Paris", "City of Paris"]], ["eiffel tower.", "Lyon"] ... ) 0.5