Views
No views yet
malariasimulation outputs. This model repository contains two exported inference artifacts:prevalence/: predicts malaria prevalence over time.cases/: predicts malaria cases over time.Mamba2Regressor architecture but have separate weights and preprocessing metadata. Users should load the folder that matches the target they want to predict.1.
2├── prevalence/
3│ ├── checkpoint/
4│ ├── model_config.json
5│ └── preprocessing_config.json
6├── cases/
7│ ├── checkpoint/
8│ ├── model_config.json
9│ └── preprocessing_config.json
10└── README.mdcheckpoint/ contains model-only Orbax checkpoint data.model_config.json contains the model architecture settings needed to instantiate Mamba2Regressor.preprocessing_config.json contains feature ordering, intervention timing, target transform settings, and the fitted static covariate scaler.malariasimulation-style simulation inputs. They are designed for research and analysis workflows where fast approximate prediction of simulated prevalence or cases is useful.1pip install mintstate
2
3# For GPU support, install with the `[gpu]` extra:
4pip install mintstate[gpu]1git clone https://github.com/mrc-ide/stateMINT.git
2cd stateMINT
3
4pip install -e .
5
6# For GPU support, install with the `[gpu]` extra:
7pip install -e .[gpu]1from stateMINT.model import Mamba2Regressor
2
3artifact = Mamba2Regressor.from_pretrained(
4 "dide-ic/stateMINT",
5 predictor="prevalence",
6 revision="v1.2.0",
7)
8
9model = artifact.model1from stateMINT.model import Mamba2Regressor
2
3artifact = Mamba2Regressor.from_pretrained(
4 "dide-ic/stateMINT",
5 predictor="cases",
6 revision="v1.2.0",
7)
8
9model = artifact.modelfrom_pretrained returns a ModelArtifact containing:artifact.model: the restored Mamba2Regressor.artifact.preprocessing_config: the exported preprocessing metadata.artifact.scaler: the fitted static covariate scaler.artifact.prepare_inputs(...): converts raw static covariate dictionaries into model inputs.artifact.predict(...): predicts directly from raw static covariate dictionaries.1from stateMINT.model import Mamba2Regressor
2
3artifact = Mamba2Regressor.from_pretrained(
4 "dide-ic/stateMINT",
5 predictor="prevalence",
6 revision="v1.2.0",
7)
8
9static_covars = [
10 {
11 "eir": 50.0,
12 "dn0_use": 0.3,
13 "dn0_future": 0.4,
14 "Q0": 0.8,
15 "phi_bednets": 0.7,
16 "seasonal": 1.0,
17 "routine": 0.5,
18 "itn_use": 0.2,
19 "irs_use": 0.1,
20 "itn_future": 0.3,
21 "irs_future": 0.2,
22 "lsm": 0.0,
23 },
24 {
25 "eir": 120.0,
26 "dn0_use": 0.2,
27 "dn0_future": 0.2,
28 "Q0": 0.9,
29 "phi_bednets": 0.6,
30 "seasonal": 1.0,
31 "routine": 0.4,
32 "itn_use": 0.3,
33 "irs_use": 0.0,
34 "itn_future": 0.5,
35 "irs_future": 0.1,
36 "lsm": 0.2,
37 },
38]
39
40predicted_prevalence = artifact.predict(static_covars)
41
42print(predicted_prevalence.shape) # (2, n_steps)
43print(predicted_prevalence[0]) # prevalence trajectory for the first scenariopredictor="cases" and call the same .predict(...) method:1artifact = Mamba2Regressor.from_pretrained(
2 "dide-ic/stateMINT",
3 predictor="cases",
4 revision="v1.2.0",
5)
6
7predicted_cases = artifact.predict(static_covars).predict(...) returns predictions on the original target scale:[0, 1];transformed=True:raw_predictions = artifact.predict(static_covars, transformed=True)(batch, time, input_size)1import jax.numpy as jnp
2
3X = artifact.prepare_inputs(static_covars)
4raw_predictions = artifact.model(jnp.asarray(X))preprocessing_config.json.1eir
2dn0_use
3dn0_future
4Q0
5phi_bednets
6seasonal
7routine
8itn_use
9irs_use
10itn_future
11irs_future
12lsm1dn0_future
2itn_future
3irs_future
4lsm
5routinetime_normalized / cyclized , scaled_static_covariates, post_intervention_flag, years_since_interventionpreprocessing_config.json:scaled_static = (raw_static - scaler_mean) / scaler_scaleprevalence = sigmoid(raw_prediction)cases = expm1(raw_prediction)prevalence and cases folders have separate checkpoints and separate fitted scalers. Always load the folder corresponding to the target being predicted.