Skip to content

Readiness adjustment tuning

This section documents utilities for estimating and tuning readiness adjustment layer (RAL) parameters in eb-optimization.

RAL tuning supports calibration of readiness thresholds and adjustment behavior based on operational outcomes, enabling balanced tradeoffs between service risk and cost efficiency.

eb_optimization.tuning.ral

Offline tuning for the Readiness Adjustment Layer (RAL).

This module contains optimization logic for selecting RAL policy parameters by minimizing Electric Barometer objectives (primarily Cost-Weighted Service Loss) over historical data.

Responsibilities: - Search bounded uplift grids to select optimal RAL parameters - Produce portable RALPolicy artifacts - Emit audit-ready diagnostics for governance and analysis

Non-responsibilities: - Applying policies to forecasts - Defining metric math (delegated to eb-metrics) - Production-time inference or real-time decisioning

tune_ral_policy(df, *, forecast_col, actual_col, cu=2.0, co=1.0, uplift_min=1.0, uplift_max=1.15, grid_step=0.01, segment_cols=None, sample_weight_col=None)

Tune a Readiness Adjustment Layer (RAL) policy via discrete grid search.

This function performs offline tuning to select multiplicative uplift factors that convert a baseline forecast into an operationally conservative readiness forecast.

The optimization objective is Cost-Weighted Service Loss (CWSL).