Adapter layer for third-party forecasting libraries in Electric Barometer
Project description
Electric Barometer · Adapters (eb-adapters)
Adapter interfaces that normalize forecasting model APIs for consistent evaluation within the Electric Barometer ecosystem.
Overview
eb-adapters provides a thin adapter layer that normalizes the interfaces of heterogeneous forecasting libraries into a consistent, evaluation-ready API. It enables models from different frameworks to be trained, predicted, and evaluated using a common contract, without requiring downstream systems to account for library-specific behaviors.
Within the Electric Barometer ecosystem, eb-adapters serves as the bridge between model implementations and evaluation logic. By isolating framework-specific details behind stable adapter interfaces, the package allows forecasting models to be compared, selected, and assessed consistently across diverse modeling stacks, while remaining usable outside the ecosystem in standalone evaluation workflows.
Role in the Electric Barometer Ecosystem
eb-adapters defines the model interface normalization layer used throughout the Electric Barometer ecosystem. It is responsible for wrapping heterogeneous forecasting libraries behind a consistent training and prediction contract, allowing models from different frameworks to be evaluated in a uniform manner.
This package focuses exclusively on adapting model APIs and handling framework-specific behaviors. It does not perform feature construction, forecast evaluation, metric definition, or decision logic. Those responsibilities are handled by adjacent layers in the ecosystem that generate inputs, apply evaluation logic, or interpret results.
By separating model integration concerns from evaluation and metric semantics, eb-adapters enables fair, reproducible comparison of forecasting approaches across diverse modeling stacks, while keeping downstream systems agnostic to underlying implementation details.
Installation
eb-adapters is distributed as a standard Python package.
pip install eb-adapters
The package supports Python 3.10 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.
from eb_adapters.statsmodels import StatsModelsAdapter
from statsmodels.tsa.arima.model import ARIMA
# Define a native model
model = ARIMA
# Wrap the model with an adapter
adapter = StatsModelsAdapter(
model_class=model,
model_kwargs={"order": (1, 1, 1)}
)
# Fit and predict using a standardized interface
adapter.fit(y_train)
y_pred = adapter.predict(horizon=7)
The same interface can be used with tree-based or machine-learning models via a different adapter:
from eb_adapters.xgboost import XGBoostAdapter
from xgboost import XGBRegressor
# Define a native model
model = XGBRegressor
# Wrap the model with an adapter
adapter = XGBoostAdapter(
model_class=model,
model_kwargs={"n_estimators": 200, "max_depth": 4}
)
# Fit and predict using the same contract
adapter.fit(X_train, y_train)
y_pred = adapter.predict(X_future)
License
BSD 3-Clause License.
© 2025 Kyle Corrie.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eb_adapters-0.1.2.tar.gz.
File metadata
- Download URL: eb_adapters-0.1.2.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92d5590d677fbe4519fcd2059b431ceb3df66a8184d48eaa2a5d5193354a0cd9
|
|
| MD5 |
dc7aef484ee914c9791c1d5337c23d3c
|
|
| BLAKE2b-256 |
0b8e560a4e5ae20918ae49beab20c35f1bf3e5451b7a3c4c0c59aa9804175e65
|
File details
Details for the file eb_adapters-0.1.2-py3-none-any.whl.
File metadata
- Download URL: eb_adapters-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76503552f31e49ebf95c636f519a66c935081979f9b180f85216a3272fe6cd2b
|
|
| MD5 |
eae9273a57efb778b422574b4c21163b
|
|
| BLAKE2b-256 |
03fda92dc64c1541e7b22a111ee87743be7d24f21856a51611fd4533f07d12b9
|