Skip to main content

Electric Barometer · Adapters (eb-adapters)

CI License: BSD-3-Clause Python Versions PyPI

Adapter interfaces that normalize forecasting model APIs for consistent evaluation within the Electric Barometer ecosystem.


Overview

eb-adapters wraps heterogeneous forecasting libraries behind a common fit / predict contract for uniform evaluation. It isolates framework-specific behavior; metrics and evaluation live in sibling packages.


Installation

eb-adapters is distributed as a standard Python package.

pip install eb-adapters

The package supports Python 3.11 and later.


Core Concepts

  • Interface normalization — Forecasting models from different libraries are wrapped behind a common training and prediction contract, enabling uniform downstream evaluation.
  • Thin adaptation layer — Adapters aim to be minimal and non-invasive, preserving native model behavior while standardizing how models are invoked.
  • Framework isolation — Library-specific configuration, defaults, and quirks are contained within adapters, preventing leakage into evaluation or orchestration layers.
  • Explicit lifecycle boundaries — Model fitting, prediction, and state management are clearly separated to support reproducibility and controlled execution.
  • Comparability over abstraction — Adapters do not attempt to hide meaningful differences between modeling approaches; they exist to make comparison feasible, not to enforce uniformity.

Minimal Example

The example below shows how a forecasting model is wrapped behind a standardized adapter interface so it can be trained and evaluated consistently alongside other models.

import numpy as np
from eb_adapters import ArimaAdapter, SarimaxAdapter

y_train = np.array([10.0, 12.0, 11.0, 13.0, 14.0, 15.0], dtype=float)
X_train = np.arange(len(y_train), dtype=float).reshape(-1, 1)
X_horizon = np.arange(7, dtype=float).reshape(-1, 1)

arima = ArimaAdapter(order=(1, 1, 1))
arima.fit(X_train, y_train)
y_pred = arima.predict(X_horizon)

sarimax = SarimaxAdapter(order=(1, 0, 0), seasonal_order=(0, 0, 0, 0))
sarimax.fit(X_train, y_train)
y_pred = sarimax.predict(X_horizon)

The same fit(X, y) / predict(X) contract is used with tree-based models:

import numpy as np
from eb_adapters import XGBoostRegressorAdapter

X_train = np.arange(20, dtype=float).reshape(-1, 1)
y_train = (2.0 * X_train[:, 0] + 1.0)
X_future = np.arange(20, 27, dtype=float).reshape(-1, 1)

adapter = XGBoostRegressorAdapter(n_estimators=50, max_depth=3)
adapter.fit(X_train, y_train)
y_pred = adapter.predict(X_future)

License

BSD 3-Clause License. © 2026 Kyle Corrie.

Metadata

Release files for eb-adapters 0.2.5

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-adapters 0.2.5
File Size Uploaded
eb_adapters-0.2.5.tar.gz 20.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eb-adapters 0.2.5
File Interpreter ABI Platform
eb_adapters-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 46.1 kB

Release files / eb_adapters-0.2.5.tar.gz

Download URL eb_adapters-0.2.5.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
52b012d7ab9abf86cce7d754daa550628d8eafbc49365b8d9e9cdc8c1f50ab30
BLAKE2b-256 checksum
How to use checksums
e8558a52dd4ffa5b9d8cc701c345df7ecdc471d96bd25a14dd477a07586002db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / eb_adapters-0.2.5-py3-none-any.whl

Download URL eb_adapters-0.2.5-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e71831ba13efc698d2c3ff006718740bf8dbb9f3aa51a524fa5393cd54ce0bc
BLAKE2b-256 checksum
How to use checksums
40e35980cee8d091fb484be6d4c5c45aba3e4157d4f027b94dfd016bd71d55b2
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.5 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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