Electric Barometer · Optimization (eb-optimization)
Decision and policy layer for the Electric Barometer ecosystem, responsible for tuning, calibration, and governed parameter selection.
Overview
eb-optimization calibrates operational parameters (cost ratios, τ, readiness controls) and freezes them into auditable runtime policies. It does not compute metrics or run evaluation panels; those belong to eb-metrics and eb-evaluation.
Installation
eb-optimization is distributed as a standard Python package.
pip install eb-optimization
Core Concepts
- Parameter governance — Operational parameters (e.g., cost ratios, tolerances) should be selected through explicit, reproducible rules rather than ad-hoc tuning or implicit defaults.
- Search over candidate spaces — Optimization is framed as deterministic search over bounded, interpretable candidate sets, enabling transparent tradeoffs and stable outcomes.
- Cost balance calibration — Asymmetric operational costs can be balanced by selecting parameters that equalize or appropriately trade off opposing risk exposures.
- Tolerance selection from residuals — Acceptable error bands can be learned directly from historical performance, reflecting empirical system behavior rather than arbitrary thresholds.
- Policy separation — Calibration logic is separated from frozen policy artifacts so that parameter selection is auditable, versioned, and safely applied in downstream systems.
- Decision-aligned optimization — Optimization is evaluated by operational interpretability and governance fitness, not by abstract numerical optimality alone.
Minimal Example
The example below illustrates a typical optimization workflow using eb-optimization: calibrating an operational parameter from historical data and applying it via a frozen policy.
import numpy as np
from eb_optimization.policies import (
CostRatioPolicy,
apply_cost_ratio_policy,
)
# Historical actuals and forecasts
y_true = np.array([10, 12, 15, 20])
y_pred = np.array([9, 14, 18, 17])
# Define a frozen cost-ratio policy
policy = CostRatioPolicy(
R_grid=(0.5, 1.0, 2.0, 3.0),
co=1.0,
)
# Estimate a global cost ratio R
R, diagnostics = apply_cost_ratio_policy(
y_true=y_true,
y_pred=y_pred,
policy=policy,
)
print(R)
License
BSD 3-Clause License. © 2026 Kyle Corrie.
Metadata
Release files for eb-optimization 0.2.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eb_optimization-0.2.8.tar.gz | 42.2 kB | Without provenance | Details for eb_optimization-0.2.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eb_optimization-0.2.8-py3-none-any.whl | Python 3 | none | any | Details for eb_optimization-0.2.8-py3-none-any.whl |
Total release size: 89.7 kB
Release files / eb_optimization-0.2.8.tar.gz
| Download URL | eb_optimization-0.2.8.tar.gz |
|---|---|
| Size | 42.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9b6f154bbec826a9e32c7c4c44ac0c4e76a1dcd42ec236b397ea363a01014a4
|
|
BLAKE2b-256 checksum How to use checksums |
8c312405e91e8a0ac6b3ef45880a82a8243099abe9165dec5075077caa1db683
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / eb_optimization-0.2.8-py3-none-any.whl
| Download URL | eb_optimization-0.2.8-py3-none-any.whl |
|---|---|
| Size | 47.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a801080842d6aa292359eea98969e725a4ac3a7be8e9af9709bd12eb80ef7018
|
|
BLAKE2b-256 checksum How to use checksums |
e5268c88b43d9112796cafaa556085cf1ff6eb286482a8e97a75fb9b2177a7a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for eb-optimization 0.2.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.