Skip to main content

Electric Barometer · Evaluation (eb-evaluation)

CI License: BSD-3-Clause Python Versions PyPI

Evaluation and model selection utilities for applying Electric Barometer metrics across entities, groups, and operational contexts.


Overview

eb-evaluation applies Electric Barometer metrics across entities, groups, and hierarchies with DataFrame-first workflows, diagnostics, and cost-aware model selection. Metric primitives live in eb-metrics; feature construction and model adapters live elsewhere.


Installation

eb-evaluation is distributed as a standard Python package.

pip install eb-evaluation

The package supports Python 3.11 and later.


Core Concepts

  • DataFrame-first evaluation — Evaluation logic operates directly on tabular forecast and observation data, enabling transparent aggregation, grouping, and comparison across entities and hierarchies.
  • Cost- and tolerance-aware scoring — Forecast performance is assessed using metrics that reflect asymmetric cost and explicitly supplied deviation thresholds, rather than purely symmetric statistical error.
  • Hierarchical and panel semantics — Evaluation respects entity boundaries, grouping structure, and temporal alignment, ensuring correctness in multi-level forecasting environments.
  • Model comparability — Forecasts produced by heterogeneous models can be evaluated and compared using a consistent set of metrics and aggregation rules.
  • Readiness-oriented selection — Model selection emphasizes execution feasibility and operational adequacy as reflected in evaluation metrics, not just aggregate accuracy, supporting decision-aligned forecasting workflows.

Minimal Example

The example below shows how forecast accuracy can be evaluated across entities using Electric Barometer metrics in a DataFrame-first workflow.

import pandas as pd
from eb_evaluation import compute_cwsl_df, evaluate_groups_df

df = pd.DataFrame({
    "entity_id": ["A", "A", "B", "B"],
    "actual": [10, 12, 7, 9],
    "prediction": [9, 11, 8, 10],
})

# Single-slice CWSL (scalar)
loss = compute_cwsl_df(
    df,
    y_true_col="actual",
    y_pred_col="prediction",
    cu=2.0,
    co=1.0,
)

# Per-entity metrics, including FRS (requires cwsl_max)
results = evaluate_groups_df(
    df,
    group_cols=["entity_id"],
    actual_col="actual",
    forecast_col="prediction",
    cu=2.0,
    co=1.0,
    cwsl_max=0.30,
)

print(loss)
print(results)

License

BSD 3-Clause License. © 2026 Kyle Corrie.

Metadata

Release files for eb-evaluation 0.2.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eb-evaluation 0.2.10
File Size Uploaded
eb_evaluation-0.2.10.tar.gz 88.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eb-evaluation 0.2.10
File Interpreter ABI Platform
eb_evaluation-0.2.10-py3-none-any.whl Python 3 none any Details

Total release size: 193.3 kB

Release files / eb_evaluation-0.2.10.tar.gz

Download URL eb_evaluation-0.2.10.tar.gz
Size 88.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5d35eff2714aae7ed186769e2953c8929231c5b7d7e5f924c5096986b040696d
BLAKE2b-256 checksum
How to use checksums
f7b372cf5c01655b09b5d600be486150b1991bda82de0dcc3ae4e0b7c37f37a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / eb_evaluation-0.2.10-py3-none-any.whl

Download URL eb_evaluation-0.2.10-py3-none-any.whl
Size 105.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72592cf7037b9cf70a918cd12d6a2a0e61fb926da8675e998dcd66813445c8d1
BLAKE2b-256 checksum
How to use checksums
38e820787a189c963d7e4ca9b66c197cf643f6b3c7be580e344edf4d90226728
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.2.10 This release

2 release files

0.2.7

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page