Skip to main content

stats-transformer

Table of Contents


1. Features

stats-transformer is a Python library for data transformation, econometric modeling, and visualization. It automates feature engineering, model estimation, and reporting across time-series, panel, and cross-sectional datasets using a reproducible configuration workflow.

  • Unified Empirical Workflow: Combines feature engineering, model estimation, diagnostic checks, and publication-ready charts in one pipeline.
  • Declarative YAML Configuration: Controls data sources, frequency resampling, transformations, model specifications, and visual outputs via params.yaml.
  • Broad Econometric Coverage: Provides unified APIs for cross-sectional (OLS, Robust OLS), panel (Fixed Effects), time-series (VAR, VECM, SVAR, Local Projections), instrumental-variables (2SLS, LP-IV), discrete-choice (Logit), and unsupervised methods (PCA, KMeans).
  • Cross-Language Validation & Agent-Ready: Numerically verified against R (stats, vars), Stata (regress, logit, pca), and MATLAB (mldivide), with an embedded architectural skill for AI agents.
  • Extensible Roadmap: Built for active expansion into high-frequency, non-linear, and structural macroeconomic extensions (see Roadmap).

2. Documentation


3. Quickstart

3.1. Installation

To use it in your project via PyPI:

pip install stats-transformer

Or add it with uv:

uv add stats-transformer

To run the notebooks under notebooks/, install the notebooks extra:

pip install "stats-transformer[notebooks]"

For local development from this repository:

uv sync

3.2. Configuration (params.yaml)

Define your data sources, pipeline parameters, and model specifications in a params.yaml file:

data:
  featurization:
    entity_column: country
  datasets:
    - name: macro_data
      path: data/raw/macro_indicators.csv
      frequency: Q

model:
  model_type: panel_ols
  target_variable: gdp_growth
  independent_variables:
    - interest_rate
    - inflation

visualization:
  output_dir: reports/visualizations

3.3. Usage

Load a packaged example dataset:

from stats_transformer.data import list_examples, load_example

print(list_examples())
df = load_example("macrodb_gdp_inflation")

You can execute the pipeline via the command line using the Pipeline orchestrator:

# Run the full end-to-end pipeline
uv run python -m stats_transformer.pipeline --config params.yaml

Or you can interact with the API programmatically:

from stats_transformer import Pipeline

# Initialize the pipeline with your configuration
pipeline = Pipeline(params_path="params.yaml")

# Run specific stages sequentially
merged_data = pipeline.run(stage="resample")
transformed_data = pipeline.run(stage="features")
model_results = pipeline.run(stage="regression")

# Generate and save visualizations
pipeline.run(stage="visualization")

3.4. Testing

Verify the installation and library integrity by running the test suite:

uv run python -m pytest -q

For more details on test coverage, see the Testing Suite.


4. Agent Skill

Source checkouts of this repository include an optional stats-transformer-architecture agent skill for AI coding tools. It gives agents a compact map of the library architecture, pipeline stages, model contracts, and feature-engineering vocabulary.

The canonical skill source lives at .agents/skills/stats-transformer-architecture/. From the repository root, use the local terminal to run scripts/install-agent-skill.sh, which installs or refreshes tool-specific copies for Claude Code, OpenAI Codex, or Kilo Code:

./scripts/install-agent-skill.sh all

You can also target one tool at a time:

./scripts/install-agent-skill.sh claude
./scripts/install-agent-skill.sh codex
./scripts/install-agent-skill.sh kilo

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stats_transformer-1.6.0.tar.gz (291.3 kB view details)

Uploaded Source

Built Distribution

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

stats_transformer-1.6.0-py3-none-any.whl (310.0 kB view details)

Uploaded Python 3

File details

Details for the file stats_transformer-1.6.0.tar.gz.

File metadata

  • Download URL: stats_transformer-1.6.0.tar.gz
  • Upload date:
  • Size: 291.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for stats_transformer-1.6.0.tar.gz
Algorithm Hash digest
SHA256 9ee11c20870b864f649c59e937d0af591994ce41042baecb3cb00e0738ed0674
MD5 1921cddc527f857518ef6100ab43798e
BLAKE2b-256 4c4dcec9673a6d5d747021b9ee182f9611a4d71016ef1f7aa178f58bd3a1da54

See more details on using hashes here.

Provenance

The following attestation bundles were made for stats_transformer-1.6.0.tar.gz:

Publisher: publish.yml on corybaird/stats-transformer

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

File details

Details for the file stats_transformer-1.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for stats_transformer-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 001ce539c9e1df661538d80af42879cdc4707aee070b1692f4fbab0c840dab16
MD5 63ce83ab2fd247650ae78cf6e5f5e26a
BLAKE2b-256 23449833b4b930e2d9d06cd20ddf44edc25146b86aad953df9ab5a234858f6f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for stats_transformer-1.6.0-py3-none-any.whl:

Publisher: publish.yml on corybaird/stats-transformer

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

Release history Release notifications | RSS feed

This release

1.6.0 This release

2 files

1.5.1

2 files

1.5.0

2 files

1.3.0

2 files

1.2.0

2 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