# xxtofff/inflation-forecasting architecture

> Architecture diagram of the GitHub repository xxtofff/inflation-forecasting, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xxtofff/inflation-forecasting
- Repository: https://github.com/xxtofff/inflation-forecasting

## Overview

This repository forecasts monthly year-on-year Philippine inflation from CPI and macroeconomic data, compares baseline, SARIMA/SARIMAX, and XGBoost methods, and reports evaluation results and multi-step forecasts. The documented workflow runs through preparation, EDA, model notebooks, and reporting; model implementations are also present under `src/models`. Notebook internals were not sampled, so notebook-to-module calls and detailed evaluation/report data flows are not asserted.

Main entry points: [`notebooks/03_naive.ipynb`](https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/03_naive.ipynb) (Baseline experiments), [`notebooks/04_sarima.ipynb`](https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/04_sarima.ipynb) (SARIMA experiments), [`notebooks/05_xgboost.ipynb`](https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/05_xgboost.ipynb) (XGBoost experiments), [`outputs/forecasts`](https://github.com/xxtofff/inflation-forecasting/tree/master/outputs/forecasts) (Forecast CSVs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data and Exploration"]
  node_raw_data[("Raw macro data")]
  node_prepare["Data preparation"]
  node_processed[("Combined dataset")]
  node_eda["Exploratory analysis<br/>[02_eda.ipynb]"]
end

subgraph group_forecast["Forecasting"]
  node_baseline["Naive baselines<br/>[naive.py]"]
  node_baseline_notebook["Baseline experiments<br/>[03_naive.ipynb]"]
  node_sarima["SARIMA models<br/>[sarima.py]"]
  node_sarima_notebook["SARIMA experiments<br/>[04_sarima.ipynb]"]
  node_xgboost["XGBoost models<br/>[xgboost.py]"]
  node_xgboost_notebook["XGBoost experiments<br/>[05_xgboost.ipynb]"]
  node_forecast_files[("Forecast CSVs")]
end

subgraph group_evaluation["Evaluation and Reporting"]
  node_test_files[("Holdout results")]
  node_report["Results report<br/>[06_report.ipynb]"]
  node_figures[("Forecast figures")]
end

node_analyst(("Project user"))

node_analyst -->|"runs first"| node_prepare
node_raw_data -->|"prepares data"| node_prepare
node_prepare -->|"creates dataset"| node_processed
node_processed -->|"explores data"| node_eda
node_eda -->|"then runs"| node_baseline_notebook
node_baseline_notebook -->|"then runs"| node_sarima_notebook
node_sarima_notebook -->|"then runs"| node_xgboost_notebook
node_xgboost_notebook -->|"then reports"| node_report
node_baseline_notebook -->|"saves forecasts"| node_forecast_files
node_sarima_notebook -->|"saves forecasts"| node_forecast_files
node_xgboost_notebook -->|"saves forecasts"| node_forecast_files
node_report -->|"generates figures"| node_figures
node_report -->|"reports results"| node_forecast_files
node_baseline_notebook -.->|"evaluates models"| node_test_files
node_sarima_notebook -.->|"evaluates models"| node_test_files
node_xgboost_notebook -.->|"evaluates models"| node_test_files
node_baseline_notebook -.->|"may use"| node_baseline
node_sarima_notebook -.->|"may use"| node_sarima
node_xgboost_notebook -.->|"may use"| node_xgboost

click node_raw_data "https://github.com/xxtofff/inflation-forecasting/tree/master/data/raw"
click node_prepare "https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/01_data_preparation.ipynb"
click node_processed "https://github.com/xxtofff/inflation-forecasting/blob/master/data/processed/combined_macro_data.csv"
click node_eda "https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/02_eda.ipynb"
click node_baseline "https://github.com/xxtofff/inflation-forecasting/blob/master/src/models/naive.py"
click node_baseline_notebook "https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/03_naive.ipynb"
click node_sarima "https://github.com/xxtofff/inflation-forecasting/blob/master/src/models/sarima.py"
click node_sarima_notebook "https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/04_sarima.ipynb"
click node_xgboost "https://github.com/xxtofff/inflation-forecasting/blob/master/src/models/xgboost.py"
click node_xgboost_notebook "https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/05_xgboost.ipynb"
click node_forecast_files "https://github.com/xxtofff/inflation-forecasting/tree/master/outputs/forecasts"
click node_test_files "https://github.com/xxtofff/inflation-forecasting/tree/master/outputs/tests"
click node_report "https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/06_report.ipynb"
click node_figures "https://github.com/xxtofff/inflation-forecasting/tree/master/outputs/figures"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_raw_data,node_prepare,node_processed,node_eda,node_analyst toneBlue
class node_baseline,node_baseline_notebook,node_sarima,node_sarima_notebook,node_xgboost,node_xgboost_notebook,node_forecast_files toneAmber
class node_test_files,node_report,node_figures toneMint
```

## Components

### Data and Exploration

- [Raw macro data](https://github.com/xxtofff/inflation-forecasting/tree/master/data/raw): `data/raw`
- [Data preparation](https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/01_data_preparation.ipynb): `notebooks/01_data_preparation.ipynb`
- [Combined dataset](https://github.com/xxtofff/inflation-forecasting/blob/master/data/processed/combined_macro_data.csv): `data/processed/combined_macro_data.csv`
- [Exploratory analysis](https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/02_eda.ipynb): `notebooks/02_eda.ipynb`

### Forecasting

- [Naive baselines](https://github.com/xxtofff/inflation-forecasting/blob/master/src/models/naive.py): `src/models/naive.py`
- [Baseline experiments](https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/03_naive.ipynb): `notebooks/03_naive.ipynb`
- [SARIMA models](https://github.com/xxtofff/inflation-forecasting/blob/master/src/models/sarima.py): `src/models/sarima.py`
- [SARIMA experiments](https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/04_sarima.ipynb): `notebooks/04_sarima.ipynb`
- [XGBoost models](https://github.com/xxtofff/inflation-forecasting/blob/master/src/models/xgboost.py): `src/models/xgboost.py`
- [XGBoost experiments](https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/05_xgboost.ipynb): `notebooks/05_xgboost.ipynb`
- [Forecast CSVs](https://github.com/xxtofff/inflation-forecasting/tree/master/outputs/forecasts): `outputs/forecasts`

### Evaluation and Reporting

- [Holdout results](https://github.com/xxtofff/inflation-forecasting/tree/master/outputs/tests): `outputs/tests`
- [Results report](https://github.com/xxtofff/inflation-forecasting/blob/master/notebooks/06_report.ipynb): `notebooks/06_report.ipynb`
- [Forecast figures](https://github.com/xxtofff/inflation-forecasting/tree/master/outputs/figures): `outputs/figures`

### Other components

- **Project user**

## Connections

- Project user → Data preparation: runs first (evidence: `README.md`)
- Raw macro data → Data preparation: prepares data (evidence: `README.md`)
- Data preparation → Combined dataset: creates dataset (evidence: `README.md`)
- Combined dataset → Exploratory analysis: explores data (evidence: `README.md`)
- Exploratory analysis → Baseline experiments: then runs (evidence: `README.md`)
- Baseline experiments → SARIMA experiments: then runs (evidence: `README.md`)
- SARIMA experiments → XGBoost experiments: then runs (evidence: `README.md`)
- XGBoost experiments → Results report: then reports (evidence: `README.md`)
- Baseline experiments → Forecast CSVs: saves forecasts (evidence: `README.md`)
- SARIMA experiments → Forecast CSVs: saves forecasts (evidence: `README.md`)
- XGBoost experiments → Forecast CSVs: saves forecasts (evidence: `README.md`)
- Results report → Forecast figures: generates figures (evidence: `README.md`)
- Results report → Forecast CSVs: reports results (evidence: `README.md`)
- Baseline experiments → Holdout results: evaluates models
- SARIMA experiments → Holdout results: evaluates models
- XGBoost experiments → Holdout results: evaluates models
- Baseline experiments → Naive baselines: may use
- SARIMA experiments → SARIMA models: may use
- XGBoost experiments → XGBoost models: may use
