Metadata-Version: 2.4
Name: macroforecast
Version: 0.9.5
Summary: Pandas-first macro forecasting workflow package
Author-email: NanyeonK <104714490+NanyeonK@users.noreply.github.com>
License: MIT
Project-URL: Documentation, https://macroforecast.readthedocs.io/
Project-URL: Repository, https://github.com/NanyeonK/macroforecast
Project-URL: Issues, https://github.com/NanyeonK/macroforecast/issues
Project-URL: Changelog, https://github.com/NanyeonK/macroforecast/blob/main/CHANGELOG.md
Keywords: forecasting,macroeconomics,fred-md,fred-qd,fred-sd,pandas
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=2.2
Requires-Dist: numpy>=2.0
Requires-Dist: scikit-learn>=1.5
Requires-Dist: statsmodels>=0.14
Requires-Dist: scipy>=1.11
Requires-Dist: openpyxl>=3.1
Provides-Extra: parquet
Requires-Dist: pyarrow>=14.0; extra == "parquet"
Provides-Extra: xgboost
Requires-Dist: xgboost<3.1,>=3.0; extra == "xgboost"
Provides-Extra: lightgbm
Requires-Dist: lightgbm>=4.0; extra == "lightgbm"
Provides-Extra: catboost
Requires-Dist: catboost>=1.2; extra == "catboost"
Provides-Extra: arch
Requires-Dist: arch>=6.0; extra == "arch"
Provides-Extra: macro-random-forest
Requires-Dist: joblib>=1.5; extra == "macro-random-forest"
Requires-Dist: matplotlib>=3.8; extra == "macro-random-forest"
Provides-Extra: interpretation
Requires-Dist: shap>=0.45; extra == "interpretation"
Requires-Dist: anatomy>=0.1.6; extra == "interpretation"
Provides-Extra: deep
Requires-Dist: torch>=2.2; extra == "deep"
Requires-Dist: captum>=0.7; extra == "deep"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0; extra == "docs"
Requires-Dist: pydata-sphinx-theme>=0.15; extra == "docs"
Requires-Dist: sphinx-design>=0.5; extra == "docs"
Requires-Dist: myst-parser>=2.0; extra == "docs"
Requires-Dist: sphinx-copybutton>=0.5; extra == "docs"
Requires-Dist: sphinxcontrib-mermaid>=0.9; extra == "docs"
Provides-Extra: typecheck
Requires-Dist: mypy>=1.13; extra == "typecheck"
Provides-Extra: markdown
Requires-Dist: tabulate>=0.9; extra == "markdown"
Provides-Extra: all
Requires-Dist: macroforecast[arch,catboost,interpretation,lightgbm,macro_random_forest,markdown,parquet,xgboost]; extra == "all"
Provides-Extra: ci
Requires-Dist: pytest>=8.0; extra == "ci"
Requires-Dist: macroforecast[markdown,parquet]; extra == "ci"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: macroforecast[all]; extra == "dev"
Dynamic: license-file

# 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

```bash
pip install -e ".[dev]"
```

Torch is not installed by default in this rebuild.

## Quick Use

```python
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_analysis.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
