Skip to main content

Pandas-first macro forecasting workflow package

Project description

macroforecast

macroforecast is being rebuilt as a pandas-first macro forecasting workflow package. The current public surface is intentionally small:

  • macroforecast.meta: package-wide defaults such as random seed and worker count.
  • macroforecast.data: canonical date-indexed panels, metadata, FRED/custom loaders, and study data specs.
  • macroforecast.preprocessing: direct pandas preprocessing callables.
  • macroforecast.data_summary: one-panel summary tables.
  • macroforecast.data_analysis: before/after preprocessing analysis.
  • macroforecast.metrics: scoring metrics and forecast-table ranking.
  • macroforecast.tests: forecast-comparison tests and diagnostics.
  • macroforecast.evaluation: namespace wrapper for metrics and tests.

The old YAML/runtime implementation is no longer part of the clean importable package. A reference copy is preserved on the legacy-runtime-reference branch.

Install

pip install -e ".[dev]"

Torch is not installed by default in this rebuild.

Quick Use

import macroforecast as mf

mf.configure(random_seed=42, n_jobs=1)

bundle = mf.data.load_custom_csv(
    "panel.csv",
    date="date",
    dataset="my_panel",
    frequency="monthly",
)

data_spec = mf.data.spec(
    bundle,
    target="INDPRO",
    horizons=[1, 3, 6],
    start="1990-01-01",
    end="2024-12-01",
)

processed = mf.preprocessing.reprocess(
    data_spec,
    transform="custom",
    transform_codes={"INDPRO": 5},
    outliers="iqr",
    impute="em_factor",
)

summary = mf.data_summary.summarize_data(processed.panel)
analysis = mf.data_analysis.analyze_data(bundle.panel, processed.panel)

Data Shape

The standard panel is a pandas.DataFrame with:

  • a DatetimeIndex named date
  • one macro series per column
  • numeric values in the cells
  • dataset metadata stored separately and mirrored in panel.attrs["macroforecast_metadata"]

macroforecast.data.load_*() returns a DataBundle(panel, metadata). macroforecast.data.spec(...) attaches target, horizon, sample-window, and predictor choices to that panel.

Documentation

Function-level documentation lives under docs/reference/.

License

MIT

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

macroforecast-0.9.5a0.tar.gz (453.1 kB view details)

Uploaded Source

Built Distribution

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

macroforecast-0.9.5a0-py3-none-any.whl (490.9 kB view details)

Uploaded Python 3

File details

Details for the file macroforecast-0.9.5a0.tar.gz.

File metadata

  • Download URL: macroforecast-0.9.5a0.tar.gz
  • Upload date:
  • Size: 453.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for macroforecast-0.9.5a0.tar.gz
Algorithm Hash digest
SHA256 d44a2c52db44c88db7e8b317855ce9c7a0000bf83d14237312e4628bbce37e14
MD5 89d50f119a416d2d60d7d39d81ef5225
BLAKE2b-256 a1a71a5c6d509da5fc38ff3166069b8ad19883c67b752108aa69ac786e5fc9b6

See more details on using hashes here.

File details

Details for the file macroforecast-0.9.5a0-py3-none-any.whl.

File metadata

File hashes

Hashes for macroforecast-0.9.5a0-py3-none-any.whl
Algorithm Hash digest
SHA256 710a6ab75c34aa7d06e1431bea68800af9bd22155a1b61839ea7e07aee8226e4
MD5 c37e9032a65e05f770b9112fff44a409
BLAKE2b-256 746cc8813c53ba49ae3846a0b8bd2c97f6864d2db8473cb7fcf86dedaf6c898d

See more details on using hashes here.

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