Skip to main content

Feature engineering utilities for panel time-series data in the Electric Barometer ecosystem.

Project description

Electric Barometer · Features (eb-features)

CI License: BSD-3-Clause Python Versions PyPI

Feature engineering primitives for panel-based forecasting systems, designed to integrate seamlessly with the Electric Barometer ecosystem.


Overview

eb-features is a modular feature engineering library for panel-based forecasting systems. It provides reusable, deterministic transformations for constructing time-aware features across entities observed over time.

Within the Electric Barometer ecosystem, eb-features serves as the upstream feature construction layer, producing standardized inputs for downstream evaluation and metric components. While designed to integrate seamlessly with Electric Barometer, the package remains framework-agnostic and can be used independently in other forecasting workflows.


Role in the Electric Barometer Ecosystem

eb-features defines the feature engineering primitives used throughout the Electric Barometer ecosystem. It is responsible for constructing deterministic, panel-aware input features—such as lags, rolling aggregations, and calendar encodings—that serve as the foundational inputs to forecasting and evaluation workflows.

This package focuses exclusively on feature construction and validation. It does not perform model training, forecast generation, metric evaluation, or decision logic. Those responsibilities are handled by downstream layers in the ecosystem that consume engineered features for modeling, selection, and operational assessment.

By separating feature semantics from modeling and evaluation concerns, eb-features provides a stable, reusable foundation that ensures consistency and reproducibility across forecasting pipelines operating on heterogeneous panel data.


Installation

eb-features is distributed as a standard Python package.

pip install eb-features

The package supports Python 3.10 and later.


Core Concepts

  • Panel-aware feature construction — Features are constructed with explicit awareness of entity boundaries and temporal ordering, ensuring correctness in multi-entity forecasting settings.
  • Deterministic transformations — Feature generation is designed to be reproducible and free of stochastic behavior, supporting auditability and consistent downstream evaluation.
  • Temporal causality — All features respect time directionality, preventing information leakage from future observations into historical feature sets.
  • Rolling and lag semantics — Common forecasting features such as lags and rolling aggregates are treated as first-class primitives with clear, well-defined behavior.
  • Validation by construction — Feature pipelines include explicit checks and constraints to ensure structural validity before model training or evaluation.

Minimal Example

The example below shows how to construct lagged and rolling features for panel data while preserving entity boundaries and temporal ordering.

import pandas as pd
from eb_features.panel.lags import add_lag_features
from eb_features.panel.rolling import add_rolling_features

# Example panel data
df = pd.DataFrame({
    "entity_id": ["A", "A", "A", "B", "B"],
    "date": pd.date_range("2024-01-01", periods=5, freq="D"),
    "y": [10, 12, 11, 7, 9],
})

# Add lagged features
df = add_lag_features(
    df,
    value_col="y",
    lags=[1, 2],
    entity_col="entity_id",
    time_col="date",
)

# Add rolling features
df = add_rolling_features(
    df,
    value_col="y",
    windows=[3],
    entity_col="entity_id",
    time_col="date",
)

print(df)

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

eb_features-0.2.4.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eb_features-0.2.4-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file eb_features-0.2.4.tar.gz.

File metadata

  • Download URL: eb_features-0.2.4.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eb_features-0.2.4.tar.gz
Algorithm Hash digest
SHA256 90b358a5dcf7c139bb6f56b5ff9bc28aa9b9ad60f206fc192523a03a4e34b61c
MD5 429de3e2323ba5a6c435243688104c33
BLAKE2b-256 72781987c6c531d03b23f439d911a7a61e6317b6a5d220134290208256b2c23b

See more details on using hashes here.

Provenance

The following attestation bundles were made for eb_features-0.2.4.tar.gz:

Publisher: release.yml on Economistician/eb-features

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eb_features-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: eb_features-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eb_features-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7759194c80eb5ea07edaea3bed235c607da917c7b22a4ef211b687070de6eaa0
MD5 f99d6c1254f846104a68f76c7fa06c3b
BLAKE2b-256 0e03f09b44ed22466969b18e3dc3ad6f89dfc65e629674a37c5caffccd7a81ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for eb_features-0.2.4-py3-none-any.whl:

Publisher: release.yml on Economistician/eb-features

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page