energykit.benchmark
ASHRAE-14 compliant forecast accuracy metrics.
energykit.benchmark — Standard metrics and benchmarks for energy AI tasks.
- class energykit.benchmark.EnergyForecastBenchmark(actual, forecast, label: str = 'model')[source]
Bases:
objectCompute and display a comprehensive forecast accuracy report.
- Parameters:
actual (array-like) – Observed values.
forecast (array-like) – Forecasted values.
label (str) – Optional label for the model (shown in report).
Examples
>>> bench = EnergyForecastBenchmark(actual, forecast, label="LightGBM 24h") >>> report = bench.summary() >>> print(report)
- energykit.benchmark.cvrmse(actual, forecast) float[source]
Coefficient of Variation of RMSE (%) — ASHRAE Guideline 14.
CVRMSE = RMSE / mean(actual) × 100- Returns:
CV(RMSE) in percent.
- Return type:
- energykit.benchmark.load_factor_error(actual, forecast) float[source]
Difference in load factor between forecast and actual.
Load factor = mean / peak. Higher = more uniform load, lower = peakier. A negative error means the forecast predicts a peakier load than reality.
- Returns:
Δ load factor = LF(forecast) − LF(actual).
- Return type:
- energykit.benchmark.mape(actual, forecast, epsilon: float = 1e-08) float[source]
Mean Absolute Percentage Error (%).
- energykit.benchmark.peak_coincidence(actual, forecast, top_pct: float = 0.1) float[source]
Fraction of actual peak hours that are also forecast as peaks.
Relevant for demand charge management: missing a peak is expensive.
- energykit.benchmark.r2(actual, forecast) float[source]
Coefficient of determination R².
- Returns:
R² ∈ (−∞, 1]. 1.0 = perfect fit.
- Return type: