# mmassaoudi-cell/acfp-qr architecture

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

- Interactive diagram: https://gitdiagram.com/mmassaoudi-cell/acfp-qr
- Repository: https://github.com/mmassaoudi-cell/acfp-qr

## Overview

This is a reproducible electricity-price recovery research pipeline, not a deployed service. Its main workflow prepares chronologically split GEFCom2014 data, screens and tunes recovery models using training/validation data, freezes an enhanced configuration, then evaluates it on test data and under robustness and network-level scenarios. The graph includes the documented result-generation and dispatch-simulation branches. Some script internals were not excerpted, so relationships for those stages follow the README’s documented workflow rather than assumed implementation details.

Main entry points: [`scripts/final_test_eval.py`](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/final_test_eval.py) (Final test evaluation), [`scripts/data_gefcom.py`](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/data_gefcom.py) (GEFCom data prep), [`scripts/robustness.py`](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/robustness.py) (Robustness sweeps), [`scripts/network_validation.py`](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/network_validation.py) (Network validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_gefcom["GEFCom data prep<br/>[data_gefcom.py]"]
  node_contamination["Attack contamination"]
end

subgraph group_recovery["Recovery models"]
  node_model_registry["Regression baselines"]
  node_candidate_models["Hybrid candidates<br/>[candidates.py]"]
end

subgraph group_experiments["Experiments and evaluation"]
  node_screening["Benchmark screening"]
  node_candidate_screen["Candidate screening"]
  node_tuning["Candidate tuning<br/>[tune_candidateA.py]"]
  node_gate_enhancement["Gate enhancement<br/>[enhance_gate.py]"]
  node_frozen_config["Frozen model config"]
  node_test_eval["Final test evaluation<br/>[final_test_eval.py]"]
  node_robustness["Robustness sweeps<br/>[robustness.py]"]
  node_metrics["Regression metrics<br/>[metrics.py]"]
  node_results["Research results"]
end

subgraph group_dispatch["Dispatch simulation"]
  node_economic_impact["Economic impact<br/>[economic_impact.py]"]
  node_ded_sim["DED simulator<br/>[ded_sim.py]"]
  node_network_validation["Network validation"]
  node_reproduce14["14-bus reproduction<br/>[reproduce_14bus.py]"]
end

node_researcher(("Researcher"))

node_researcher -.->|"runs pipeline"| node_gefcom
node_gefcom -->|"prepares splits"| node_screening
node_gefcom -->|"provides data"| node_candidate_screen
node_contamination -->|"corrupts features"| node_candidate_screen
node_model_registry -->|"supplies baselines"| node_screening
node_candidate_models -->|"supplies candidates"| node_candidate_screen
node_candidate_screen -.->|"selects candidates"| node_tuning
node_tuning -.->|"precedes revision"| node_gate_enhancement
node_gate_enhancement -->|"informs config"| node_frozen_config
node_frozen_config -->|"configures evaluation"| node_test_eval
node_gefcom -->|"provides data"| node_test_eval
node_contamination -->|"corrupts features"| node_test_eval
node_candidate_models -->|"supplies hybrid"| node_test_eval
node_model_registry -->|"supplies baselines"| node_test_eval
node_test_eval -->|"computes scores"| node_metrics
node_test_eval -->|"measures efficiency"| node_economic_impact
node_test_eval -->|"writes evaluation"| node_results
node_researcher -.->|"runs sweeps"| node_robustness
node_robustness -->|"loads splits"| node_gefcom
node_robustness -->|"generates attacks"| node_contamination
node_robustness -->|"fits final model"| node_candidate_models
node_robustness -->|"scores predictions"| node_metrics
node_candidate_models -->|"uses dispatch costs"| node_economic_impact
node_economic_impact -->|"uses generators"| node_ded_sim
node_researcher -.->|"runs validation"| node_network_validation
node_network_validation -->|"loads data"| node_gefcom
node_network_validation -->|"trains recovery"| node_candidate_models
node_network_validation -->|"creates attacks"| node_contamination
node_network_validation -->|"simulates dispatch"| node_ded_sim
node_researcher -.->|"runs reproduction"| node_reproduce14
node_reproduce14 -->|"solves scenarios"| node_ded_sim
node_researcher -.->|"reviews reports"| node_results

click node_gefcom "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/data_gefcom.py"
click node_contamination "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/attack_contamination.py"
click node_model_registry "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/models_regression.py"
click node_candidate_models "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/candidates.py"
click node_screening "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/benchmark_regression.py"
click node_candidate_screen "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/screen_candidates.py"
click node_tuning "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/tune_candidateA.py"
click node_gate_enhancement "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/enhance_gate.py"
click node_frozen_config "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/FINAL_MODEL_CONFIG.yaml"
click node_test_eval "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/final_test_eval.py"
click node_robustness "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/robustness.py"
click node_metrics "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/metrics.py"
click node_economic_impact "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/economic_impact.py"
click node_ded_sim "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/ded_sim.py"
click node_network_validation "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/network_validation.py"
click node_reproduce14 "https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/reproduce_14bus.py"
click node_results "https://github.com/mmassaoudi-cell/acfp-qr/tree/main/results/aggregate"

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_gefcom,node_contamination toneBlue
class node_model_registry,node_candidate_models toneAmber
class node_screening,node_candidate_screen,node_tuning,node_gate_enhancement,node_frozen_config,node_test_eval,node_robustness,node_metrics,node_results toneMint
class node_economic_impact,node_ded_sim,node_network_validation,node_reproduce14 toneRose
class node_researcher toneIndigo
```

## Components

### Data preparation

- [GEFCom data prep](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/data_gefcom.py): `scripts/data_gefcom.py`
- [Attack contamination](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/attack_contamination.py): `scripts/attack_contamination.py`

### Recovery models

- [Regression baselines](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/models_regression.py): `scripts/models_regression.py`
- [Hybrid candidates](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/candidates.py): `scripts/candidates.py`

### Experiments and evaluation

- [Benchmark screening](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/benchmark_regression.py): `scripts/benchmark_regression.py`
- [Candidate screening](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/screen_candidates.py): `scripts/screen_candidates.py`
- [Candidate tuning](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/tune_candidateA.py): `scripts/tune_candidateA.py`
- [Gate enhancement](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/enhance_gate.py): `scripts/enhance_gate.py`
- [Frozen model config](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/FINAL_MODEL_CONFIG.yaml): `FINAL_MODEL_CONFIG.yaml`
- [Final test evaluation](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/final_test_eval.py): `scripts/final_test_eval.py`
- [Robustness sweeps](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/robustness.py): `scripts/robustness.py`
- [Regression metrics](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/metrics.py): `scripts/metrics.py`
- [Research results](https://github.com/mmassaoudi-cell/acfp-qr/tree/main/results/aggregate): `results/aggregate`

### Dispatch simulation

- [Economic impact](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/economic_impact.py): `scripts/economic_impact.py`
- [DED simulator](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/ded_sim.py): `scripts/ded_sim.py`
- [Network validation](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/network_validation.py): `scripts/network_validation.py`
- [14-bus reproduction](https://github.com/mmassaoudi-cell/acfp-qr/blob/main/scripts/reproduce_14bus.py): `scripts/reproduce_14bus.py`

### Other components

- **Researcher**

## Connections

- Researcher → GEFCom data prep: runs pipeline (evidence: `README.md`)
- GEFCom data prep → Benchmark screening: prepares splits (evidence: `scripts/benchmark_regression.py`)
- GEFCom data prep → Candidate screening: provides data (evidence: `scripts/screen_candidates.py`)
- Attack contamination → Candidate screening: corrupts features (evidence: `scripts/screen_candidates.py`)
- Regression baselines → Benchmark screening: supplies baselines (evidence: `scripts/benchmark_regression.py`)
- Hybrid candidates → Candidate screening: supplies candidates (evidence: `scripts/screen_candidates.py`)
- Candidate screening → Candidate tuning: selects candidates (evidence: `README.md`)
- Candidate tuning → Gate enhancement: precedes revision (evidence: `README.md`)
- Gate enhancement → Frozen model config: informs config (evidence: `README.md`)
- Frozen model config → Final test evaluation: configures evaluation (evidence: `README.md`)
- GEFCom data prep → Final test evaluation: provides data (evidence: `scripts/final_test_eval.py`)
- Attack contamination → Final test evaluation: corrupts features (evidence: `scripts/final_test_eval.py`)
- Hybrid candidates → Final test evaluation: supplies hybrid (evidence: `scripts/final_test_eval.py`)
- Regression baselines → Final test evaluation: supplies baselines (evidence: `scripts/final_test_eval.py`)
- Final test evaluation → Regression metrics: computes scores (evidence: `scripts/final_test_eval.py`)
- Final test evaluation → Economic impact: measures efficiency (evidence: `scripts/final_test_eval.py`)
- Final test evaluation → Research results: writes evaluation (evidence: `README.md`)
- Researcher → Robustness sweeps: runs sweeps (evidence: `README.md`)
- Robustness sweeps → GEFCom data prep: loads splits (evidence: `scripts/robustness.py`)
- Robustness sweeps → Attack contamination: generates attacks (evidence: `scripts/robustness.py`)
- Robustness sweeps → Hybrid candidates: fits final model (evidence: `scripts/robustness.py`)
- Robustness sweeps → Regression metrics: scores predictions (evidence: `scripts/robustness.py`)
- Hybrid candidates → Economic impact: uses dispatch costs (evidence: `scripts/candidates.py`)
- Economic impact → DED simulator: uses generators (evidence: `scripts/economic_impact.py`)
- Researcher → Network validation: runs validation (evidence: `README.md`)
- Network validation → GEFCom data prep: loads data (evidence: `scripts/network_validation.py`)
- Network validation → Hybrid candidates: trains recovery (evidence: `scripts/network_validation.py`)
- Network validation → Attack contamination: creates attacks (evidence: `scripts/network_validation.py`)
- Network validation → DED simulator: simulates dispatch (evidence: `scripts/network_validation.py`)
- Researcher → 14-bus reproduction: runs reproduction (evidence: `README.md`)
- 14-bus reproduction → DED simulator: solves scenarios (evidence: `scripts/reproduce_14bus.py`)
- Researcher → Research results: reviews reports (evidence: `README.md`)
