Skip to content

metrics

Functions:

NameDescription
MetricFuncMetric function protocol.
maeMean Absolute Error.
pearson_correlationMean Pearson correlation over the target dimensions.
rmseRoot Mean Squared Error.

Bases: Protocol

Metric function protocol.

Accepts predictions and observations of the same shape and returns a metric value.

mae(predictions, observations)

Mean Absolute Error.

Parameters:

NameTypeDescriptionDefault
predictionsndarray or Tensor(N,), (N, D), or (B, N, D).required
observationsndarray or TensorSame shape as predictions.required

Returns:

TypeDescription
ndarray or Tensor() for 1D/2D input, (B,) for 3D input.

Raises:

TypeDescription
ValueError- If predictions and observations have different shapes. - If the inputs are not 1D, 2D, or 3D.
pearson_correlation(predictions, observations)

Mean Pearson correlation over the target dimensions.

The correlation is computed per target dimension along the sample axis, then averaged over the dimensions.

Parameters:

NameTypeDescriptionDefault
predictionsndarray or Tensor(N,), (N, D), or (B, N, D).required
observationsndarray or TensorSame shape as predictions.required

Returns:

TypeDescription
ndarray or Tensor() for 1D/2D input, (B,) for 3D input.

Raises:

TypeDescription
ValueError- If predictions and observations have different shapes. - If the inputs are not 1D, 2D, or 3D.
rmse(predictions, observations)

Root Mean Squared Error.

Parameters:

NameTypeDescriptionDefault
predictionsndarray or Tensor(N,), (N, D), or (B, N, D).required
observationsndarray or TensorSame shape as predictions.required

Returns:

TypeDescription
ndarray or Tensor() for 1D/2D input, (B,) for 3D input.

Raises:

TypeDescription
ValueError- If predictions and observations have different shapes. - If the inputs are not 1D, 2D, or 3D.