Skip to content

8. Reproduce the paper figures

To plot the figures in the paper, download the Zenodo reproducibility archive and run the command below. It uses the saved generated seasons, forecasts, reconstructions, observations, and score tables to produce the four main data figures and four supplementary figures. You do not need to retrain the models, generate forecasts, or calculate scores again.

Zenodo DOI: 10.5281/zenodo.22699980.

Paper reproducibility

You can bypass plotting by getting the final figures in regenerated_paper_figures/ directly from the Zenodo reproducibility archive (archive README).

If you have not completed the previous stages, you can start plotting with the archive's forecasts/, observations/, analysis/, and model_candidate_evaluation/ folders. These supply the saved samples, observations, losses, and scores needed by the command below.

Extract the archive to influpaint-paper/influpaint_paper_reproduction_data/ under the research repository. The Zenodo archive README lists the saved inputs and their provenance.

1. Plot the figures

Install the Python environment, activate it, and run from the research repository root:

Bash
python -m paper_figures.final_figures \
  --data-root influpaint-paper/influpaint_paper_reproduction_data

The command reads the archive and writes plots to influpaint-paper/influpaint_paper_reproduction_data/regenerated_paper_figures/. To save them elsewhere, add --output-dir:

Bash
python -m paper_figures.final_figures \
  --data-root influpaint-paper/influpaint_paper_reproduction_data \
  --output-dir reproduced_figures

The plotting seed defaults to 0. --seed changes random choices made by the plotting routines; it does not regenerate the archived model samples. This command reproduces plots from saved results. To train models or calculate new scores, follow steps 1โ€“7.

2. Open the output files

The following paths are relative to the output directory. Input paths are relative to the extracted reproducibility folder.

Figure Output filename Saved inputs and what the figure shows
Figure 1: generated seasons and correlations 868_figure1_unconditional_correlation.png Unconditional samples in forecasts/unconditional/ and historical hospitalizations in observations/nhsn_flusight_past.csv; compares generated epidemic curves and their correlation structure with observed seasons
Figure 2: short-horizon forecasts 868_figure2_csv_forecasts_two_seasons.png CSVs in forecasts/retrospective/, observed hospitalizations, and FluSight ensemble forecasts; plots forecast medians and intervals for the two evaluated seasons
Figure 3: full-season forecasts 868_figure3_npy_forecasts_two_seasons.png Arrays in forecasts/retrospective/ and observations; shows the complete trajectories behind the short-horizon quantiles
Figure 4: missing-data reconstructions 868_figure4_mask_experiments.png Samples, masks, and truth in forecasts/masks/; compares six reconstructions from 2023โ€“2024
Supplementary Figure 1: model-choice comparison sup_forest_effect.png model_candidate_evaluation/leaderboards/leaderboard_full.csv; compares changes in forecast scores when varying one setting at a time
Supplementary Figure 2: training losses sup_training_loss.png analysis/mlflow_losses.csv and analysis/mlflow_loss_timeseries.csv; plots training losses for the candidates
Supplementary Figure 3: loss versus forecast score sup_lossVSwis.png Training-loss and leaderboard tables; compares denoising loss with absolute and relative WIS
Supplementary Figure 4: operational forecasts 868_Relaizedforecast.png Actual submissions in forecasts/operational/ and observations; shows forecasts submitted during the operational seasons

868_Relaizedforecast.png is the filename used by the script, including that spelling. The operational submissions span historical model versions; they were not all produced by the selected retrospective i868 checkpoint.

The command also writes:

  • 868_figure1_correlation_summary.json: numerical correlation summaries for Figure 1.
  • flusight_dropbox_analysis.csv: a summary of the archived operational leaderboard snapshots in analysis/FlusightScores/.
  • 2024-2025_wis_pairgrid.png: a comparison plot from those leaderboard snapshots.

The leaderboard-summary step reads published score tables; it does not rescore the underlying operational forecasts. The static methods diagram is not generated by this command.

3. Check the plots

Open the figures and confirm that the state names, seasons, and dates match the figure you want to reproduce. Figure 1 uses generated seasons without current-season conditioning; Figures 2โ€“3 use retrospective forecasts; Figure 4 uses reconstruction masks. Supplementary Figure 4 uses the separate operational submissions.

For your own results, change the input paths and selected model settings in paper_figures/config.py and the relevant figure functions in paper_figures/final_figures.py. The supplied plots assume the paper's model and comparison dates. For a weekly operational forecast, use the notebook in step 9, which exports reports for the date you select.

Previous: 7. Reconstruct missing observations ยท Next: 9. Generate operational forecasts