Integrating Machine Learning
To call Machine Learning models from your rule project, you must import a machine learning model into Rule Designer.
Before you begin
About this task
You manage Machine Learning references from the project context menu in Rule Designer. The Machine Learning
references panel has three options:
The following task focuses on the Create option for integrating your machine learning models.
Procedure
Results
- A XOM project is created with two Java™ classes:
- Class 1 (the name matches the last field in the Create panel) contains:
- Name matches 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()). See below for the list of possible return codes. - Getters for the output values
- Class 2: If Machine Learning cannot be accessed at runtime then you can configure it to use default values, by specifying this is permitted in your rules. See Example of a machine learning call. When default values are needed the runtime obtains them from this bean class.
- Class 1 (the name matches the last field in the Create panel) contains:
- A BOM class is created providing a verbalization for the new XOM
- A variable set is created with two variables:
- An instance of the BOM class, to be used for accessing Machine Learning
- A variable which holds the Deployment ID, for use when calling Machine Learning
- Sample rules in the Rule Package. The first rule makes a call to Machine
Learning, and the second rule uses the score that Machine Learning returns.: Note: This sample rule can be used as the basis of your actual call. At the end of the sample rule it prints out the returned values. You delete these print statements and use the output values in the rules that follow on in the rule flow.