# mcompetitions/m4-methods architecture

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

- Interactive diagram: https://gitdiagram.com/mcompetitions/m4-methods
- Repository: https://github.com/mcompetitions/m4-methods

## Overview

M4-methods is a competition archive: it collects training and test data, participant forecasting implementations and submissions, benchmark code, prediction intervals, and evaluation results. A typical user workflow is to inspect the series and metadata, reproduce forecasts with an available method or benchmark, then compare the published forecast and evaluation artifacts. The README documents these capabilities but does not specify a single end-to-end runtime. Source excerpts show some benchmark and neural-network internals; other participant methods are represented by their exact directories or archive paths, not inferred implementation details.

Main entry points: [`Point Forecasts`](https://github.com/mcompetitions/m4-methods/tree/master/Point%20Forecasts) (Point submissions), [`211 - btrotta/predict.py`](https://github.com/mcompetitions/m4-methods/blob/master/211%20-%20btrotta/predict.py) (Neural prediction), [`211 - btrotta/train_models.py`](https://github.com/mcompetitions/m4-methods/blob/master/211%20-%20btrotta/train_models.py) (Neural model training), [`Prediction Intervals`](https://github.com/mcompetitions/m4-methods/tree/master/Prediction%20Intervals) (Prediction intervals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Competition data"]
  node_dataset[("Series and metadata")]
end

subgraph group_methods["Forecast methods"]
  node_participant["Participant methods"]
  node_statbench["Statistical benchmarks"]
  node_mlbench["ML benchmarks<br/>[ML_benchmarks.py]"]
  node_theta["4Theta method<br/>[4Theta method.R]"]
  node_nntraining["Neural model training<br/>[train_models.py]"]
  node_nnmodels["Neural architectures"]
  node_nnutilities["Series preparation<br/>[utilities.py]"]
  node_nnpredict["Neural prediction<br/>[predict.py]"]
end

subgraph group_results["Forecast artifacts"]
  node_pointforecasts[("Point submissions")]
  node_intervals[("Prediction intervals")]
end

subgraph group_evaluation["Evaluation"]
  node_nnmetrics["Forecast metrics<br/>[metrics.py]"]
  node_rankings["Scores and ranks"]
end

node_user(("Researcher"))

node_user -->|"inspects series"| node_dataset
node_user -->|"reproduces methods"| node_participant
node_user -->|"runs evaluation"| node_statbench
node_user -->|"reproduces benchmarks"| node_mlbench
node_user -->|"reproduces method"| node_theta
node_user -->|"compares submissions"| node_pointforecasts
node_user -->|"compares intervals"| node_intervals
node_user -->|"reviews results"| node_rankings
node_nntraining -->|"constructs models"| node_nnmodels
node_nntraining -->|"prepares series"| node_nnutilities
node_nntraining -->|"evaluates forecasts"| node_nnmetrics
node_nnpredict -->|"loads models"| node_nnmodels
node_nnpredict -->|"prepares predictions"| node_nnutilities
node_nnpredict -.->|"writes forecasts"| node_pointforecasts
node_nnpredict -.->|"writes bounds"| node_intervals
node_statbench -->|"generates forecasts"| node_pointforecasts
node_mlbench -->|"generates forecasts"| node_pointforecasts
node_theta -->|"generates forecasts"| node_pointforecasts
node_pointforecasts -->|"evaluated in"| node_rankings
node_intervals -->|"evaluated in"| node_rankings

click node_dataset "https://github.com/mcompetitions/m4-methods/tree/master/Dataset"
click node_participant "https://github.com/mcompetitions/m4-methods/tree/master/043%20-%20gbonte"
click node_statbench "https://github.com/mcompetitions/m4-methods/blob/master/Benchmarks%20and%20Evaluation.R"
click node_mlbench "https://github.com/mcompetitions/m4-methods/blob/master/ML_benchmarks.py"
click node_theta "https://github.com/mcompetitions/m4-methods/blob/master/4Theta%20method.R"
click node_nntraining "https://github.com/mcompetitions/m4-methods/blob/master/211%20-%20btrotta/train_models.py"
click node_nnmodels "https://github.com/mcompetitions/m4-methods/blob/master/211%20-%20btrotta/model_definitions.py"
click node_nnutilities "https://github.com/mcompetitions/m4-methods/blob/master/211%20-%20btrotta/utilities.py"
click node_nnmetrics "https://github.com/mcompetitions/m4-methods/blob/master/211%20-%20btrotta/metrics.py"
click node_nnpredict "https://github.com/mcompetitions/m4-methods/blob/master/211%20-%20btrotta/predict.py"
click node_pointforecasts "https://github.com/mcompetitions/m4-methods/tree/master/Point%20Forecasts"
click node_intervals "https://github.com/mcompetitions/m4-methods/tree/master/Prediction%20Intervals"
click node_rankings "https://github.com/mcompetitions/m4-methods/blob/master/Evaluation%20and%20Ranks.xlsx"

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_dataset toneBlue
class node_participant,node_statbench,node_mlbench,node_theta,node_nntraining,node_nnmodels,node_nnutilities,node_nnpredict toneAmber
class node_pointforecasts,node_intervals toneMint
class node_nnmetrics,node_rankings toneRose
class node_user toneIndigo
```

## Components

### Competition data

- [Series and metadata](https://github.com/mcompetitions/m4-methods/tree/master/Dataset): `Dataset`

### Forecast methods

- [Participant methods](https://github.com/mcompetitions/m4-methods/tree/master/043%20-%20gbonte): `043 - gbonte`
- [Statistical benchmarks](https://github.com/mcompetitions/m4-methods/blob/master/Benchmarks%20and%20Evaluation.R): `Benchmarks and Evaluation.R`
- [ML benchmarks](https://github.com/mcompetitions/m4-methods/blob/master/ML_benchmarks.py): `ML_benchmarks.py`
- [4Theta method](https://github.com/mcompetitions/m4-methods/blob/master/4Theta%20method.R): `4Theta method.R`
- [Neural model training](https://github.com/mcompetitions/m4-methods/blob/master/211%20-%20btrotta/train_models.py): `211 - btrotta/train_models.py`
- [Neural architectures](https://github.com/mcompetitions/m4-methods/blob/master/211%20-%20btrotta/model_definitions.py): `211 - btrotta/model_definitions.py`
- [Series preparation](https://github.com/mcompetitions/m4-methods/blob/master/211%20-%20btrotta/utilities.py): `211 - btrotta/utilities.py`
- [Neural prediction](https://github.com/mcompetitions/m4-methods/blob/master/211%20-%20btrotta/predict.py): `211 - btrotta/predict.py`

### Forecast artifacts

- [Point submissions](https://github.com/mcompetitions/m4-methods/tree/master/Point%20Forecasts): `Point Forecasts`
- [Prediction intervals](https://github.com/mcompetitions/m4-methods/tree/master/Prediction%20Intervals): `Prediction Intervals`

### Evaluation

- [Forecast metrics](https://github.com/mcompetitions/m4-methods/blob/master/211%20-%20btrotta/metrics.py): `211 - btrotta/metrics.py`
- [Scores and ranks](https://github.com/mcompetitions/m4-methods/blob/master/Evaluation%20and%20Ranks.xlsx): `Evaluation and Ranks.xlsx`

### Other components

- **Researcher**

## Connections

- Researcher → Series and metadata: inspects series (evidence: `README.md`)
- Researcher → Participant methods: reproduces methods (evidence: `README.md`)
- Researcher → Statistical benchmarks: runs evaluation (evidence: `README.md`)
- Researcher → ML benchmarks: reproduces benchmarks (evidence: `README.md`)
- Researcher → 4Theta method: reproduces method (evidence: `README.md`)
- Researcher → Point submissions: compares submissions (evidence: `README.md`)
- Researcher → Prediction intervals: compares intervals (evidence: `README.md`)
- Researcher → Scores and ranks: reviews results (evidence: `README.md`)
- Neural model training → Neural architectures: constructs models (evidence: `211 - btrotta/train_models.py`)
- Neural model training → Series preparation: prepares series (evidence: `211 - btrotta/train_models.py`)
- Neural model training → Forecast metrics: evaluates forecasts (evidence: `211 - btrotta/train_models.py`)
- Neural prediction → Neural architectures: loads models (evidence: `211 - btrotta/predict.py`)
- Neural prediction → Series preparation: prepares predictions (evidence: `211 - btrotta/predict.py`)
- Neural prediction → Point submissions: writes forecasts
- Neural prediction → Prediction intervals: writes bounds
- Statistical benchmarks → Point submissions: generates forecasts (evidence: `README.md`)
- ML benchmarks → Point submissions: generates forecasts (evidence: `README.md`)
- 4Theta method → Point submissions: generates forecasts (evidence: `README.md`)
- Point submissions → Scores and ranks: evaluated in (evidence: `README.md`)
- Prediction intervals → Scores and ranks: evaluated in (evidence: `README.md`)
