Skip to content
DHIS2.org Community GitHub

Getting started as a model developer

The Chap platform brings several advantages to you as a model developer:

How a model runs in Chap

A Chap model is a train script and a predict script, in R or Python, plus a short MLproject file that tells Chap how to run them. Once your model is Chap-compatible, you can use it in two ways:

  • On your own machine, with the chap command-line tool. One command evaluates the model on a dataset and plots its forecasts:

    chap eval --model-name . --dataset-csv data.csv --output-file eval.nc --plot --run-config.as-chapkit
    
  • In the Chap Modeling App, where users can evaluate it on DHIS2 data, compare it with other models and make forecasts. For this, you package the model as a Docker image and add it to a Chap installation, see Running Your Own Model.

Where to start

First set up your machine. Then pick the guide that fits you:

You... Start here
already have a forecasting model in R or Python Bring your existing model to Chap
want to build a new model Build a new model from a template
are not used to the terminal, git, or installing Python or R packages Development tools, then come back here
want to learn statistical modelling and forecasting Learning modelling

Both model guides use the same MLproject format and the same chap eval command. They only differ in where you start: from your own code, or from a template.

Strictly, Chap only requires that a model exposes the chapkit REST API. The train and predict scripts and the MLproject file are the recommended way to get there, since chapkit then provides the API for you. Advanced users can write a service that implements the API directly, see the chapkit documentation. Most models do not need this.