View source on GitHub |
Factory method to get a list of ranking metrics.
tfr.keras.metrics.get(
key: str,
name: Optional[str] = None,
dtype: Optional[tf.dtypes.DType] = None,
topn: Optional[int] = None,
**kwargs
) -> tf.keras.metrics.Metric
Example Usage:
metric = tfr.keras.metics.get(tfr.keras.metrics.RankingMetricKey.MRR)
to get Mean Reciprocal Rank.
metric = tfr.keras.metics.get(tfr.keras.metrics.RankingMetricKey.MRR,
topn=2)
to get MRR@2.
Returns | |
---|---|
A tf.keras.metrics.Metric. See _RankingMetric signature for more details.
|
Raises | |
---|---|
ValueError
|
If key is unsupported. |