Example of a Machine Learning call
An example that calls Machine Learning churn predictions that you can use in your rules.
To get started, import the Machine Learning Shipped sample ‘CHURN’ into the miniloandemo project in Rule Designer. See Integrating Machine Learning for details of importing a (model).
After you have imported the CHURN model into Rule Designer, you can see two sample rules. The first example rule shows you how to make a call to Machine Learning:
then
set the EDUCATION of 'the churnScoring' to 1;
set the AGE of 'the churnScoring' to 30;
set the SEX of 'the churnScoring' to "M";
set the NEGTWEETS of 'the churnScoring' to 8;
set the INCOME of 'the churnScoring' to 30000;
set the ACTIVITY of 'the churnScoring' to 1;
set the STATE of 'the churnScoring' to "CA";
set the deployment ID of 'the churnScoring' to 'the deploymentID in variable set
ChurnScoringModel';
make it true that 'the churnScoring' is permitted to use defaults ;
execute 'the churnScoring' ;
print "ML return code="+the return code of 'the churnScoring';
print "prediction=" + the prediction of 'the churnScoring';
- The default values now have valid values for CHURN. For example:
a SEX of "M" a STATE of "CA" - Also, it is now true that defaults can be used. When set to true, Machine Learning cannot be accessed at run time, it uses default values. These are obtained from the default class generated in your Machine Learning XOM.
You can also alter the last two lines so that the decision of Machine Learning is passed back via the messages of the loan – meaning that the ODM sample COBOL program prints out these lines when you call ODM via WOLA.
add "ML return code="+the return code of 'the churnScoring' to the messages of 'the loan' ;
add "prediction=" + the prediction of 'the churnScoring' to the messages of 'the loan' ;
The second churn example rule shows you how to integrate Machine Learning prediction scores into your rules:
if the prediction of 'the churnScoring' is at most 10 then
print "prediction <= 10";
else
print "prediction > 10";
You can then deploy the rule project to the Rule Execution Server Console in the usual way and test
it out by submitting HBRMINW. If it works correctly, you see your two
extra loan messages in the output, showing the result of the Machine Learning call.