A Decision Table Example Model
RASON users have the ability to create and evaluate Decision Tables, starting with RASON V2019. A decision table contains a set of rules which specify actions to perform based on specific conditions. Decision tables are a good tool to use when there is a consistent number of rules, or conditions, to be evaluated followed by a specific set of actions to be performed once a rule, or condition, is met. For example, the simple decision table below returns a patient's medical risk rating based on their age and medical history.
{
modelName : "ExampleDT",
modelType: "calculation",
data: {
age: { value: 54 }, medHistory: { value: 'good' }
},
decisionTables: {
tblRisk: {
inputs: ['age', 'medHistory'], outputs: ['riskRating', 'rule'],
rules: [
['>60', 'bad', 'High', 'r2'],
['[25..60]', '-', 'Medium', 'r3'],
['<25', 'good', 'Low', 'r4'],
],
hitPolicy: 'Unique'
}
},
formulas: {
res: { formula: "tblRisk(,,age, medHistory)", finalValue: [] }
}
}
The results, as for optimization, simulation and data science models, are returned in JSON. A 54-year old patient with a good medical history rates as "medium" for his/her medical risk rating. See the chapter Defining Decision Tables in RASON for more information on how to define a decision table using the RASON modeling language.
{ "status": {
"code": 0,
"id": "2590+productMixCSV2Example+2020-01-02-05-21-19-476102",
"codeText": "Solver has completed the calculation." },
"observations": { "res": { "value": [ ["Medium", "r3"] ] } }
}
Back to A Data Science Example
|