graphtoolbox.training.metrics

graphtoolbox.training.metrics.MAE(preds: Tensor | ndarray, targets: Tensor | ndarray) Tensor | float[source][source]

Mean Absolute Error (MAE) between predictions and targets.

Parameters:
  • preds (Union[torch.Tensor, np.ndarray]) – Predicted values.

  • targets (Union[torch.Tensor, np.ndarray]) – True values.

Returns:

The mean absolute error.

Return type:

Union[torch.Tensor, float]

graphtoolbox.training.metrics.NMAE(preds: Tensor | ndarray, targets: Tensor | ndarray) Tensor | float[source][source]

Normalized Mean Absolute Error (NMAE) between predictions and targets.

Parameters:
  • preds (Union[torch.Tensor, np.ndarray]) – Predicted values.

  • targets (Union[torch.Tensor, np.ndarray]) – True values.

Returns:

The normalized mean absolute error.

Return type:

Union[torch.Tensor, float]

graphtoolbox.training.metrics.MAPE(preds: Tensor | ndarray, targets: Tensor | ndarray) Tensor | float[source][source]

Mean Absolute Percentage Error (MAPE) between predictions and targets.

Parameters:
  • preds (Union[torch.Tensor, np.ndarray]) – Predicted values.

  • targets (Union[torch.Tensor, np.ndarray]) – True values.

Returns:

The mean absolute percentage error.

Return type:

Union[torch.Tensor, float]

graphtoolbox.training.metrics.RMSE(preds: Tensor | ndarray, targets: Tensor | ndarray) Tensor | float[source][source]

Root Mean Square Error (RMSE) between predictions and targets.

Parameters:
  • preds (Union[torch.Tensor, np.ndarray]) – Predicted values.

  • targets (Union[torch.Tensor, np.ndarray]) – True values.

Returns:

The root mean square error.

Return type:

Union[torch.Tensor, float]

graphtoolbox.training.metrics.BIAS(preds: Tensor | ndarray, targets: Tensor | ndarray) Tensor | float[source][source]

Bias between predictions and targets.

Parameters:
  • preds (Union[torch.Tensor, np.ndarray]) – Predicted values.

  • targets (Union[torch.Tensor, np.ndarray]) – True values.

Returns:

The bias (mean error).

Return type:

Union[torch.Tensor, float]