Installation
Requirements
Python 3.10 or later
pandas, numpy, scikit-learn, statsmodels, scipy, matplotlib, openpyxl, PyYAML
Install from PyPI
pip install macroforecast
Optional extras:
pip install 'macroforecast[deep]'
pip install 'macroforecast[xgboost,lightgbm]'
pip install 'macroforecast[tuning]'
pip install 'macroforecast[shap]'
pip install 'macroforecast[all]'
Or pin to a tagged GitHub release directly:
pip install "git+https://github.com/NanyeonK/macroforecast.git@v0.9.0a0"
Install from source (development)
git clone https://github.com/NanyeonK/macroforecast.git
cd macroforecast
pip install -e ".[dev]"
Verify installation
import macroforecast
print(f"macroforecast version: {macroforecast.__version__}") # 0.9.0a0
Run the test suite:
python -m pytest tests/ -x -q -m "not deep"
Expected: 1318 tests pass / 19 skipped / 4 deselected in ~85 seconds (local core baseline).
Optional dependencies
macroforecast has several optional dependencies for specific features. Install only what you need:
Package |
Required for |
Install |
|---|---|---|
|
Bayesian optimization tuning |
|
|
TreeSHAP, KernelSHAP, LinearSHAP importance |
|
|
LIME local surrogate importance |
|
|
XGBoost model family |
|
|
LightGBM model family |
|
|
CatBoost model family |
|
|
LSTM / GRU / TCN model families |
see |
(openpyxl is now a core dependency in v0.6.3+ since FRED-SD Excel workbook
loading is a baseline FRED-SD code path.)
Install all optional dependencies at once:
pip install "macroforecast[all] @ git+https://github.com/NanyeonK/macroforecast.git@v0.9.0a0"
All optional dependencies are import-guarded. The package works without them, but the corresponding features will raise ImportError with a clear message when invoked.
The [deep] extra
The lstm, gru, and tcn model families ship behind an opt-in [deep] extra so core installs stay free of a torch dependency:
pip install "macroforecast[deep] @ git+https://github.com/NanyeonK/macroforecast.git@v0.9.0a0"
Without the extra, referencing model_family in {lstm, gru, tcn} at sweep time raises a clear ExecutionError with the install hint.
For CPU-only torch (sufficient unless a GPU sweep is planned):
pip install --index-url https://download.pytorch.org/whl/cpu torch
pip install "macroforecast[deep] @ git+https://github.com/NanyeonK/macroforecast.git@v0.9.0a0"
Core dependencies (automatically installed)
Package |
Purpose |
|---|---|
|
Data handling and DataFrame output |
|
Numerical computation |
|
Model families (Ridge, Lasso, RF, etc.), preprocessing, CV |
|
AR models, statistical tests |
|
Statistical routines and numerical utilities |
|
L7 figure rendering (bar / heatmap / pdp / US choropleth) |
|
FRED-SD Excel workbook loading |
|
Recipe YAML parsing |
See also: Researchers: Quickstart