metrics
Functions:
| Name | Description |
|---|---|
MetricFunc | Metric function protocol. |
mae | Mean Absolute Error. |
pearson_correlation | Mean Pearson correlation over the target dimensions. |
rmse | Root Mean Squared Error. |
MetricFunc
Section titled “MetricFunc”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:
| Name | Type | Description | Default |
|---|---|---|---|
predictions | ndarray or Tensor | (N,), (N, D), or (B, N, D). | required |
observations | ndarray or Tensor | Same shape as predictions. | required |
Returns:
| Type | Description |
|---|---|
ndarray or Tensor | () for 1D/2D input, (B,) for 3D input. |
Raises:
| Type | Description |
|---|---|
ValueError | - If predictions and observations have different shapes. - If the inputs are not 1D, 2D, or 3D. |
pearson_correlation
Section titled “pearson_correlation”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:
| Name | Type | Description | Default |
|---|---|---|---|
predictions | ndarray or Tensor | (N,), (N, D), or (B, N, D). | required |
observations | ndarray or Tensor | Same shape as predictions. | required |
Returns:
| Type | Description |
|---|---|
ndarray or Tensor | () for 1D/2D input, (B,) for 3D input. |
Raises:
| Type | Description |
|---|---|
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:
| Name | Type | Description | Default |
|---|---|---|---|
predictions | ndarray or Tensor | (N,), (N, D), or (B, N, D). | required |
observations | ndarray or Tensor | Same shape as predictions. | required |
Returns:
| Type | Description |
|---|---|
ndarray or Tensor | () for 1D/2D input, (B,) for 3D input. |
Raises:
| Type | Description |
|---|---|
ValueError | - If predictions and observations have different shapes. - If the inputs are not 1D, 2D, or 3D. |