Skip to content
DHIS2.org Community GitHub

report Command Reference

The report command trains a model on a dataset and runs the model's optional report entry point to produce a PDF document describing the trained model (diagnostics, fitted-effect plots, posterior summaries, or whatever the model author chooses to emit).

Synopsis

chap report <MODEL_PATH> <DATASET_CSV> <OUT_FILE> [OPTIONS]

Description

chap report:

  1. Loads the model template from a local MLProject directory or a GitHub URL.
  2. Loads historic data from a CSV file (auto-discovering the matching .geojson if present).
  3. Trains the model on the dataset by invoking the MLProject's train entry point.
  4. Invokes the MLProject's report entry point with the freshly trained model and the same historic data.
  5. Writes the resulting PDF to out_file.

The model must declare a report entry point in its MLproject file. See Additional Configuration → Report Entry Point. Models that do not define report will fail with an explicit error.

Required Parameters

Parameter Description
model_path Path to an MLProject directory or a GitHub URL pointing to one
dataset_csv Path to a CSV file with historic data in the standard Chap format
out_file Output path for the generated PDF report

A GeoJSON file with the same base name as dataset_csv is auto-discovered if present.

Run Configuration

The same --run-config.* flags as on chap eval are available — most relevant here:

Parameter Description Default
--run-config.ignore-environment Skip automatic environment setup false
--run-config.debug Enable verbose debug logging false
--run-config.log-file Path to write log output None
--run-config.run-directory-type Directory handling: latest, timestamp, or use_existing timestamp

Additional Options

Parameter Description Default
--model-configuration-yaml Path to a YAML file with model-specific parameter values None

If the model declares user_options and the report entry point lists model_config as a parameter, the YAML file is forwarded to the report script the same way it is for train and predict.

Example

chap report \
    ./my_model \
    ./data/vietnam.csv \
    ./reports/vietnam_report.pdf

With debug logging:

chap report \
    https://github.com/dhis2-chap/my_model \
    ./data.csv \
    ./report.pdf \
    --run-config.debug \
    --run-config.log-file ./report.log

See Also