Editing the invocation rule

The invocation rule invokes machine learning models hosted remotely. You can optionally edit the invocation rule that is generated by default.

About this task

The invocation rule is generated by default when you create a predictive model. You can modify the rule to define conditions that must be satisfied in order to invoke the machine learning model.

For example, when an input data is out of the range within which the machine learning model was trained, the prediction becomes unreliable. To prevent the final decision model from using this prediction, you can add a condition that tests for the range of the value.

Procedure

  1. Open the predictive model.
  2. Select the invocation node, open the Logic tab, and click the invocation rule to open it. By default, the rule invokes the deployment that you imported. It looks like this:
    set decision to predict ( 'Ml model input' ) ;
  3. Define the condition part of the invocation rule.
    For example, the following invocation rule returns a prediction only if the age of the patient is within the range 28-78. If the patient is younger or older than that, the rule returns null.
    if the age is more than 28 and the age is less than 78
    then
    set decision to predict ( 'ML model input' ) ;