End user can dispute a card transaction and the system has to decide if the dispute can be automatically processed (aka accept the dispute and refund the user) or if it requires to have manual verification
- Business Central (with jPMML) installed -> https://access.redhat.com/documentation/en-us/red_hat_decision_manager/7.8/html/designing_a_decision_service_using_dmn_models/dmn-model-creating-proc_dmn-models#dmn-included-models-pmml-proc_dmn-models
- Transaction risk predictor ML model (dtree_risk_predictor.pmml PROVIDE FILE) -> link to notebook to create a ML model https://github.com/kiegroup/trusty-ai-sandbox/blob/master/pmml-notebook/notebook.ipynb
NOTE: be sure PMML file is a valid XML
- Create project "Card Dispute"
- Import Asset "dtree_risk_predictor.pmml" in package "com"
- Create DMN Model "Dispute Transaction Check" in package "com"
- Create "tTransaction" Data Type with transaction_amount (number) and cardholder_identifier (number) fields
- Import Models, select PMML model and name it "Risk Predictor"
- Create Node BKM with name "Risk Predictor" of type P (PMML), select "Risk Predictor" file and "DecisionTreeClassifier" as model
- Create Input node with name "Transaction" and type "tTransaction"
- Create Decision node "Transaction Dispute Risk" with "Transaction" node as input and "Risk Predictor" as function
- Type of the decision "Invocation", specify as function name "Risk Predictor", "amount" parameter with Literal expression "Transaction.transaction_amount" and "holder_index" parameter with Literal expression "Transaction.cardholder_identifier"
- Create Input node with name "Risk threshold" and type "number"
- Create Decision node "Can be automatically processed?" that takes as inputs "Transaction Dispute Risk" and "Risk threshold"
- Select Literal expression and use "Transaction Dispute Risk.predicted_dispute_risk < Risk threshold"
- Save
NOTE: predicted_dispute_risk is the name of the target field specified in the PMML file
- Create Test Scenario asset in package "com"
- Provide name "Test Dispute Transaction Check"
- Select DMN and "Dispute Transaction Check"
- Remove column "Transaction Dispute Risk"
- Specify values
Description | Risk Threshold | cardholder_identifier | transaction_amount | Can be automatically processed? |
---|---|---|---|---|
Risk threshold 5, automatically processed | 5 | 1234 | 1000 | true |
Risk threshold 4, amount = 1000, not processed | 4 | 1234 | 1000 | false |
Risk threshold 4, amount = 180, automatically processed | 4 | 1234 | 180 | true |
Risk threshold 1, amount = 1, not processed | 1 | 1234 | 1 | false |
- Execute