metrics_deterministic#

Metrics for forecasts that predict single values instead of probability distributions.

Deterministic forecasts predict one specific value (e.g., “load will be 100 MW”). These metrics measure how close predicted values are to actual values, with special attention to peak load events that are critical for energy system operations.

Key focus areas:

  • Scale-invariant errors: Compare accuracy across different load levels

  • Peak detection: Identify when load will exceed operational thresholds

  • Operational effectiveness: Ensure predictions support actionable decisions

Functions#

completeness(y)

Calculate the completeness of data.

confusion_matrix(y_true, y_pred, *, ...)

Calculate confusion matrix for peak detection in energy load.

fbeta(precision_recall[, beta])

Calculate the F-beta score from precision and recall metrics.

mae(y_true, y_pred, *[, sample_weights, ...])

Calculate the Mean Absolute Error (MAE).

mape(y_true, y_pred)

Calculate the Mean Absolute Percentage Error (MAPE).

precision_recall(cm, *[, effective])

Calculate precision and recall metrics from a confusion matrix.

r2(y_true, y_pred, *[, sample_weights])

Calculate the R² (coefficient of determination) score.

relative_pinball_loss(y_true, y_pred, *, ...)

Calculate the relative Pinball Loss (also known as relative Quantile Loss).

riqd(y_true, y_pred_lower_q, y_pred_upper_q, *)

Calculate the relative Inter Quantile Distance (rIQD).

rmae(y_true, y_pred, *[, lower_quantile, ...])

Calculate the relative Mean Absolute Error (rMAE) using percentiles for range calculation.

Classes#

ConfusionMatrix(true_positives, ...)

Confusion matrix components for peak detection in energy forecasting.

PrecisionRecall(precision, recall)

Container for precision and recall metrics.