CRC Simulation Graph

This file contains code to make predictions using the LifeCRC model from the biomodel package. It uses various OMOPIds to represent different health factors such as age, waist size, height, alcohol consumption, smoking, and dietary habits. The code then creates a ‘current’ dictionary with values for these health factors and uses the model to predict changes based on additional information about physical activity and alcohol consumption. Finally, it displays the predicted changes.

 1"""
 2This file contains code to make predictions using the LifeCRC model from the biomodel package. It uses various OMOPIds to represent different health factors such as age, waist size, height, alcohol consumption, smoking, and dietary habits. The code then creates a 'current' dictionary with values for these health factors and uses the model to predict changes based on additional information about physical activity and alcohol consumption. Finally, it displays the predicted changes.
 3"""
 4from biomodel.models import LifeCRC
 5from biomodel.biomodel import OMOPId
 6
 7if __name__ == '__main__':
 8    model = LifeCRC()
 9
10    age = OMOPId("age")
11    waist = OMOPId(4172830)
12    height = OMOPId(607590)
13    alcohol = OMOPId(4027639)
14    smoking = OMOPId(1585856)
15    physical = OMOPId(4038719)
16    vegetable = OMOPId(4025582)
17    dairy = OMOPId(4022880)
18    processed = OMOPId(4028164)
19    sugar = OMOPId(4023854)
20
21    current = {
22        age: 50,
23        waist: 85,
24        height: 170,
25        alcohol: 0,
26        smoking: 0,
27        physical: 0,
28        vegetable: 200 / 100,
29        dairy: 300 / 100,
30        processed: 50 / 50,
31        sugar: 50 / 50,
32    }
33    prediction = model.predict_person(
34        current,
35        {
36            "Physical Activity": {physical: 1},
37            "Alcohol Consumption": {alcohol: 1},
38        },
39    )
40
41    prediction.show_change()
../_images/crc_graph.png