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.5a1.tar.gz (454.9 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.5a1-py3-none-any.whl (492.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: macroforecast-0.9.5a1.tar.gz
  • Upload date:
  • Size: 454.9 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.5a1.tar.gz
Algorithm Hash digest
SHA256 c3da34df2ea7d327394e2d692f252328869a3eef007ea2d651b88d9847a6e06f
MD5 7a898a2bf4a0cf2005fbcbfab4133eba
BLAKE2b-256 9f4a907cd895fa7e8a739aa9fbb4e8501cf303fe815975cb6309c4f8699ac371

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for macroforecast-0.9.5a1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd53b5559711dcfdc6624a650e178d2aa375a444164d9c524b85403c4e0a7616
MD5 4b3ec3e929b0856884401927339e1f68
BLAKE2b-256 608fd11e735a7a42f494efd35a59ca1093b97dddc5eed7d1db726d487309d086

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