metrics
metrics
Section titled “metrics”Functions:
| Name | Description |
|---|---|
validate_and_promote | Validate shape match and promote 1D to 2D. |
rhos | Pearson correlation per dimension. |
mean_rho | Mean Pearson correlation. |
rmse | Root Mean Squared Error. |
mae | Mean Absolute Error. |
Attributes:
| Name | Type | Description |
|---|---|---|
MetricFunc | TypeAlias | MetricFunc is a function that takes (predictions, observations) and returns a metric value. |
MetricFunc
Section titled “MetricFunc”MetricFunc: TypeAlias = Callable[[np.ndarray, np.ndarray], np.ndarray]MetricFunc is a function that takes (predictions, observations) and returns a metric value.
validate_and_promote
Section titled “validate_and_promote”validate_and_promote(predictions: np.ndarray, observations: np.ndarray) -> tuple[np.ndarray, np.ndarray]Validate shape match and promote 1D to 2D.
rhos(predictions: np.ndarray, observations: np.ndarray) -> np.ndarrayPearson correlation per dimension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
predictions | ndarray | (N,), (N, D), or (B, N, D). | required |
observations | ndarray | Same shape as predictions. | required |
Returns:
| Type | Description |
|---|---|
ndarray | (1,) for 1D input, (D,) for 2D, (B, D) for 3D. |
mean_rho
Section titled “mean_rho”mean_rho(predictions: np.ndarray, observations: np.ndarray) -> np.ndarrayMean Pearson correlation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
predictions | ndarray | (N,), (N, D), or (B, N, D). | required |
observations | ndarray | Same shape as predictions. | required |
Returns:
| Type | Description |
|---|---|
ndarray | () for 1D/2D input, (B,) for 3D input. |
rmse(predictions: np.ndarray, observations: np.ndarray) -> np.ndarrayRoot Mean Squared Error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
predictions | ndarray | (N,), (N, D), or (B, N, D). | required |
observations | ndarray | Same shape as predictions. | required |
Returns:
| Type | Description |
|---|---|
ndarray | () for 1D/2D input, (B,) for 3D input. |
mae(predictions: np.ndarray, observations: np.ndarray) -> np.ndarrayMean Absolute Error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
predictions | ndarray | (N,), (N, D), or (B, N, D). | required |
observations | ndarray | Same shape as predictions. | required |
Returns:
| Type | Description |
|---|---|
ndarray | () for 1D/2D input, (B,) for 3D input. |