paddlets.metrics.base
- class Metric(mode: str = 'normal', **kwargs)[source]
Bases:
ABCAbstract base class used to build new Metric.
- Parameters
mode (str) – Supported metric modes, only normal and prob are valid values. Set to normal for non-probability use cases, set to prob for probability use cases. Note that mode = prob is currently not supported.
kwargs – Keyword parameters of specific metric functions.
- abstract metric_fn(y_true: ndarray, y_pred: ndarray, **kwargs) float[source]
Compute metric’s value from ndarray.
- Parameters
y_true (np.ndarray) – Ground truth (correct) target values.
y_pred (np,ndarray) – Estimated target values.
- Returns
Computed metric value.
- Return type
float
- Raises
ValueError. –