How devulapallitharun/interpretable-price-forecasting works
This is an Indian food-price forecasting product: historical price and weather data become a feature-rich time-series dataset, XGBoost and Temporal Fusion Transformer (TFT) models produce point and probabilistic forecasts, and ensemble and conformal-calibration stages improve the prediction bands. Evaluation and statistical explainability support a Streamlit dashboard for history, future forecasts, explanations, and test comparisons. The README documents the broader pipeline; sampled source excerpts confirm several training, prediction, fusion, and dashboard internals. Raw input files are described but absent from the supplied tree.
Main entry points: master_dataset.csv Master dataset · app.py Streamlit dashboard · 01_fetch_weather.py Weather fetching · 04_train_xgboost.py XGBoost baseline
Components 19
Data preparation
- Price filtering
scripts/00_filter_prices.py - Weather fetching
scripts/01_fetch_weather.py - Feature merging
scripts/02_merge_features.py - Master dataset
data/processed/master_dataset.csv
Forecast models
- XGBoost baseline
scripts/04_train_xgboost.py - TFT training
scripts/03_train_tft.py - TFT retraining
scripts/09_retrain_tft_2022.py - XGBoost fusion
scripts/10_xgb_as_tft_feature.py - TFT prediction
scripts/05_generate_tft_predictions.py
Forecast refinement
- Checkpoint ensemble
scripts/07_ensemble_predict.py - Conformal calibration
scripts/08_conformal_calibrate.py - Forecast evaluation
scripts/06_evaluate.py - Statistical explanations
scripts/11_explainability_stats.py - Forecast artifacts
data/processed/tft_predictions.csv
Insights and dashboard
- Streamlit dashboard
app.py
Other components
- WFP price data
- Market coordinates
- NASA POWER
- Dashboard user
Connections 22
- WFP price data → Price filtering: filters prices
README.md - Price filtering → Feature merging: prepares prices
README.md - Market coordinates → Weather fetching: provides coordinates
README.md - Weather fetching → NASA POWER: fetches weather
README.md - Weather fetching → Feature merging: supplies weather
README.md - Feature merging → Master dataset: writes features
README.md - Master dataset → XGBoost baseline: trains baseline
scripts/04_train_xgboost.py - Master dataset → TFT training: trains model
README.md - Master dataset → TFT retraining: trains extended
README.md - Master dataset → XGBoost fusion: trains fused model
scripts/10_xgb_as_tft_feature.py - XGBoost baseline → XGBoost fusion: adds feature
scripts/10_xgb_as_tft_feature.py - TFT training → TFT prediction: generates forecasts
scripts/05_generate_tft_predictions.py - TFT retraining → Checkpoint ensemble: supplies checkpoints
README.md - XGBoost fusion → Checkpoint ensemble: supplies checkpoints
README.md - Checkpoint ensemble → Forecast artifacts: writes averages
scripts/07_ensemble_predict.py - Forecast artifacts → Conformal calibration: calibrates bands
README.md - Conformal calibration → Forecast evaluation: evaluates forecasts
README.md - Forecast evaluation → Statistical explanations: validates results
README.md - Dashboard user → Streamlit dashboard: views forecasts
README.md - Forecast artifacts → Streamlit dashboard: loads forecasts
README.md - XGBoost baseline → Streamlit dashboard: supports inference
README.md - TFT prediction → Streamlit dashboard: supports TFT views