Skip to content

Reporting

Disease Reporter (C-DSI)

High-level reporting interface for ClimAID.

The DiseaseReporter is responsible for transforming model outputs into structured, human-readable narratives. It acts strictly as a post-processing layer and does not perform any statistical modeling or inference.

This separation ensures that reporting remains modular, reproducible, and independent of the underlying modeling pipeline.

Features
  • Template-based reports Fully deterministic summaries generated without LLMs (offline-safe).
  • LLM-generated scientific reports Rich, narrative outputs using local or remote language models.
  • Policy briefs Concise, decision-oriented summaries for public health stakeholders.
  • Interactive Q&A Exploratory analysis interface for research workflows.
LLM Compatibility

The reporter is backend-agnostic and works with any LLM client that implements the following interface:

generate(prompt: str) -> str
  • This includes:
    • Local LLMs (e.g., Ollama, LM Studio)
    • Remote APIs (e.g., OpenAI, other providers)
Notes
  • This class never performs modeling or prediction.
  • All inputs are expected to be precomputed outputs from ClimAID models.
  • Designed for reproducibility and flexible deployment (offline/online).

_deterministic_engine(artifacts)

ClimAID Deterministic Scientific Interpreter (C-DSI).

This method generates structured, human-readable reports directly from precomputed model artifacts, without relying on any language model. It is automatically used as a fallback when an LLM is unavailable.

The engine operates purely on validated inputs and does not introduce any generative or probabilistic interpretation, ensuring zero risk of hallucinated content.

Parameters:

Name Type Description Default
artifacts dict or object

Structured outputs from the modeling pipeline (e.g., projections, summaries, statistics).

required

Returns:

Name Type Description
str str

A deterministic, scientifically grounded report.

Notes
  • Uses only explicit, precomputed values from the pipeline.
  • No external dependencies or model calls.
  • Ensures reproducibility and auditability of results.
  • Intended for secure, offline, or high-integrity workflows.

_build_prompt(a, style)

Construct the LLM prompt for scientific report generation.

This method transforms structured report artifacts into a formatted prompt suitable for language model inference. It encodes ClimAID’s scientific context (e.g., CMIP6 projections, epidemiological signals) and ensures consistent, high-quality narrative generation.

The prompt is carefully designed to: - Preserve scientific accuracy from input artifacts - Guide the LLM toward structured, domain-specific outputs - Minimize ambiguity and reduce hallucination risk

Parameters:

Name Type Description Default
a ReportArtifacts

Structured outputs from the ClimAID pipeline, including projections, summary statistics, and derived indicators.

required
style str

Output style for the generated report.

  • Typical options include:
    • "scientific" : formal, publication-style narrative
    • "policy" : concise, decision-oriented summary
    • "technical" : detailed analytical interpretation
required

Returns:

Name Type Description
str str

A fully constructed prompt ready to be passed to an LLM client.

Notes
  • This method does not perform inference; it only prepares the prompt.
  • Prompt design is critical for ensuring reproducible and reliable outputs.
  • Compatible with both local and remote LLM backends.

Visualization Utilities

build_projection_from_summary(projection_summary)

Create an interactive mean projection plot from summary outputs.

Parameters:

Name Type Description Default
projection_summary dict

Must contain "ensemble_timeseries".

required

Returns:

Name Type Description
plot

plotly.graph_objects.Figure

build_dual_seasonal_heatmap(projection_summary, years_ahead=5)

Create dual heatmaps of seasonal projections and uncertainty.

Parameters:

Name Type Description Default
projection_summary dict

Must contain "ssp_timeseries".

required
years_ahead int

Number of years to include.

5

Returns:

Name Type Description
plot

plotly.graph_objects.Figure or str

build_ssp_projection_grid(projection_summary)

Create a grid of SSP-specific projection time series.

Each subplot represents a different SSP scenario for comparison.

Parameters:

Name Type Description Default
projection_summary dict

Must contain "ssp_timeseries".

required

Returns:

Name Type Description
plot

plotly.graph_objects.Figure

build_climate_sensitivity_panel(importance)

Visualize feature importance for climate sensitivity based on the base model selected inside the DiseaseModel Class.

Parameters:

Name Type Description Default
importance dict

Mapping of variables to importance scores.

required

Returns:

Name Type Description
plot

plotly.graph_objects.Figure or str

build_risk_matrix(projection_summary, years_per_period=5)

Create a temporal risk matrix visualization.

Parameters:

Name Type Description Default
projection_summary dict

Must contain "risk_matrix".

required
years_per_period int

default = 5

5

Returns:

Name Type Description
plot

plotly.graph_objects.Figure or str