Conducting completeness analysis

Conduct a completeness analysis to evaluate the decision logic of your decision model, determine whether it makes decisions for all the defined cases, and generate missing rules to enhance your decision logic. You can conduct the completeness analysis on decision models only and not on task models.

About this task

In this example, a decision service is created and a completeness analysis is conducted to evaluate the decision logic of the decision model.

Procedure

  1. Create a decision service with the necessary specifications. For example, define the following specifications:
    • An input data node called customer of type customer.
    • A decision node called category of type string that depends on the customer node.
    • The customer type with age and cart value attributes.
  2. Define the decision logic by providing the rules in the rule editor.
    if
         < condition >
    then
         < action >
    For more information, see Rule structure.
    In this example, the following rules are defined. These rules define the customer by specifying the age and cart value. The rules set the category value to Gold, Silver, or Platinum based on the age and cart value conditions.

    Rule 1

    if
        the age of customer is at least 30
        and the cart value of customer is at most 20
    then 
        set decision to "Gold" ; 

    Rule 2

    if
        the age of customer is more than 5
        and the age of customer is less than 20
        and the cart value of customer is more than 10
        and the cart value of customer is less than 35
    then 
        set decision to "Gold" ; 

    Rule 3

    if
        the age of customer is at most 15 
        and the cart value of customer is at most 15 
    then 
        set decision to "Silver" ; 

    Rule 4

    if
        the age of customer is at least 20 
        and the cart value of customer is at least 35 
    then 
        set decision to "Platinum" ; 

    Rule 5

    if
        the age of customer is at most 10
        and the cart value of customer is at least 30
    then 
        set decision to "Gold" ; 
  3. In the Modeling tab, click the customer node.
  4. To conduct the completeness analysis and generate missing rules, click the Analyze the decision logic icon Analyze the decision logic icon, in the Logic tab.
    The time taken to generate missing rules depends on various factors. These factors might include the number of variable bindings of a rule, the number of logical tests in the rule conditions, and the mathematical operations that are used in the logical rules.
    The analyzer might take longer than usual to generate missing rules for a complicated decision logic.
  5. Optional: If missing rules are generated, review them, define meaningful actions and approve the rules.

    If your decision logic is incomplete, the completeness analyzer identifies any missing rules that can be added to the decision logic to improve it. These missing rules are rule skeletons and provide only meaningful conditions. The actions consist of generic default decisions.

    Missing rules are formulated with the help of logical tests that occur in the original rules. Their conditions are logical conjunctions that are formulated with those logical tests or their negations. If completeness analysis terminates without reaching a timeout, missing rules do not overlap with the original rules and thus cover only cases that are not already covered by the original rules. However, missing rules may overlap with other missing rules, which can cause multiple missing rules to cover the same case.

    The generated missing rules are in their most general form, which limits the number of missing rules that are generated. A maximum of 10 missing rules is generated in one request.

    1. Review the missing rules.
      Newly generated missing rules are not active and are highlighted in the UI. The following rule is an example of a generated missing rule.
      if
          the age of customer is less than 20 
          and the age of customer is more than 10 
          and the cart value of customer is more than 35 
      then
          -- This is a generated rule. Choose a meaningful value for the decision variable. 
          set decision to "" ; 
    2. Edit the missing rules to define the actions that are to be taken, based on your decision logic. Parsing errors appear only in the editor and not in the error report.
      For example, set the decision variable of the following missing rule to Gold.
      if
          the age of customer is less than 20 
          and the age of customer is more than 10 
          and the cart value of customer is more than 35 
      then 
          set decision to "Gold" ; 
    3. Approve the missing rule by clicking the overflow menu overflow menu of the rule and selecting Approve. When you approve a missing rule, it becomes a regular rule and is no longer highlighted. When you run a model, all active rules are used. Potential errors appear in the error report. You can undo the approval of a missing rule by clicking the Undo icon undo.
    4. Generate more missing rules if necessary, by repeating the actions from step 4. If extra missing rules are generated, they might overlap with other missing rules, but they do not overlap with the missing rules that were approved. The generation of missing rules cannot be undone.