Integrating a Machine Learning model
To call a Machine Learning model from your rule
project, you must import the model into Rule Designer.
Before you begin
You must have the Miniloan decision service and the Mortgage Approval Prediction Model downloaded to your computer. See Applying a Machine Learning model.
About this task
This task shows you how to add a Machine Learning model to a decision service. You import the model into Rule Designer and integrate it into the decision service.
Procedure
Results
- XOM with two Java™ classes:
- Class 1:
- Name taken from the bottom field in the create panel
- Getters and setters for the input values in the swagger file
- Method to set the deployment ID (
setDeploymentID(String)) - Method to do a model execution (
execute()) - Method to query if the returned values are from the defaults
(
isReturningDefaultValues()) - Method to get the a return code from the call (
getReturnCode()). (List below of possible return codes.) - Getters for the output values
- Class 2:
If Machine Learning cannot be accessed at run time, you can configure it to use default values by specifying that this is permitted in your rules. When default values are needed, the runtime obtains them from this bean class.
- Class 1:
- A BOM class is created that provides a verbalization for the new XOM
- A variable set is created with two variables:
- BOM class to be used for accessing Machine Learning
- Deployment ID for use when calling Machine Learning
- Sample rules in the rule package:
- Rule 1 calls Machine Learning.
- Rule 2 uses the score from Machine Learning.
This sample rules can be used in your call. At the end, the rule prints out the returned values. You delete these print statements and use the output values in the rules that follow in the ruleflow.