ForecastHealth / botech-comparisons

An online table for creating comparisons of models given arbitrary amounts of filters
Apache License 2.0
0 stars 0 forks source link
botech utility

botech comparisons

asciicast

Description

Generate tables of results, which are extracted from a data source.

Part of the Botech ecosystem, written by Forecast Health Australia

Context

This repository was created because we were generating a lot of health-economic model data, often from different sources, and we wanted to compare it in lots of ways.
I was frustrated with hard coding comparisons, and felt there was a better way to do it. There are lots of solutions to this type of thing, but it seemed marginally easier to write a new package that we could modify as our use cases changed.

How I use it

  1. Have some general mechanism to convert modelling results to a csv of Records
  2. Generate a configuration file
  3. Invoke this package, either by installing it, or running the main script and passing your files as arguments.
  4. Use the results however you'd like e.g.
    • Render the results as an html and host them on a website

Installation

Requirements

Setup

Usage

Data Types

There are two python dataclasses and one enum which are important to understand: The Record, the Comparison and the Filter. You can find their definitions in the datatypes module.

In particular:

The configuration file

Write a config.json, which defines the following:

{
    "data_type": "comparisons",
    "data_format": "html",
    "scenarios": ["baseline", "scaleup"],
    "groups": [
        ["region", "income"]
    ],
    "filters": {
        "income": ["HIGH INCOME"],
        "intervention": [0]
    }
}

The API

Please refer to the init.py to read the high-level api create_tables(). The configuration can be created by parsing a JSON configuration using parse_configurations and the data will need to be provided by the user and parsed using something like pandas.read_csv().

Contributing

Feel free to fork, or submit a user issue. If you'd like to be added as a contributor, please message me, or email our website Forecast Health Australia

Tests

Tests are built with unittest and can be run locally using

python -m unittest discover tests

from the root directory.

Authors

Rory Watts, Forecast Health Australia

License

This repository is licensed under the Apache 2.0 License.

Contact Information

Please