Delivering Trusted AI with Humility Rules

November 6, 2020
by
· 4 min read

This post was originally part of the DataRobot Community. Visit now to browse discussions and ask questions about DataRobot, AI Platform, data science, and more.

The Humility tab is useful for configuring rules that enable models to recognize, in real-time, when they make uncertain predictions or receive data they haven’t seen before. In these cases, you can specify actions to take for individual predictions, allowing you to have desired behaviors with rules that depend on different triggers.

You use humility rules to associate trigger conditions with corresponding actions. Using humility rules helps to mitigate risk for model predictions in production.

Fig 1
Figure 1. Humility tab

You create humility rules for a deployment from the Humility > Rules tab. If you have not yet enabled humility for a model, toggle on Enable humility. Then, create a new rule by selecting Add Rule. Alternatively, you can select Use Recommended Rules, which will generate two automatically configured humility rules: one is a trigger for uncertain predictions, and the other if for handling outliers for the most important numeric feature.

Clicking Add Rule brings up options for configuring the new rule. Click the pencil icon to give the new rule a name.  Directly below are two dropdown lists: one to select a trigger that detects a rule violation and one to select the action to apply to the violating prediction (i.e., the trigger).

Fig 2a
Figure 2. Add Rule button
Fig 2b
Figure 3. New rule entry

Creating a New Humility Rule

There are three triggers available, and each trigger has additional values to configure how it detects violations. 

Trigger types

Fig 3
Figure 4. Uncertain Predictions

Uncertain Prediction detects whether a prediction’s value that falls between defined thresholds. You set the lower-bound and upper-bound thresholds for prediction values, by either entering the values manually or clicking Calculate to use computed values derived from the holdout set. For regression models, the trigger detects any values outside of the configured thresholds; for binary classification models, the trigger detects any prediction’s probability value that is inside of the thresholds.

Fig 4
Figure 5. Outlying inputs (outliers)

Outlying Input detects if the input value of a numeric feature is outside of the configured thresholds. To configure the outlying input trigger, select a numeric feature and set the lower-bound and upper-bound thresholds for its input values. Enter the values manually or click Calculate to use computed thresholds derived from the training data of the model (computed thresholds is available only for models built within DataRobot). 

Fig 5
Figure 6. Low Observation Region (input value outside thresholds)

Low Observation Region detects if the input value of a categorical feature is not included in the list of specified values. For this trigger, select a categorical feature and enter one or more values. Any input value that appears in prediction requests but does not match the indicated values triggers the corresponding action.

Actions

After you select any trigger, choose a corresponding action to apply for a rule violation. There are three actions available; each can be used with any of the three triggers.

Fig 6
Figure 7. No operation action

No operation results in no changes being made to the detected prediction value.

Fig 7
Figure 8. Override prediction action

Override prediction modifies predicted values for rows violating the trigger with the value configured by the action. Set a value that will overwrite the returned value for predictions violating the trigger. For binary classification and multiclass models, the indicated value can be set to either of the model’s class labels (e.g., “True” or “False”). For regression models, manually enter a value or use the maximum, minimum, or mean provided by DataRobot (available only for models built within DataRobot).

Fig 8
Figure 9. Throw Error action

Throw error returns a 480 HTTP error with the predictions for any row in violation of the trigger.  This also contributes to the data error rate on the Service Health tab. You can use the default error message provided, or specify your own custom error message. This 480 HTTP error and message will appear as part of the predictions.

When you’ve finished configuring the rule, click Add to save it. 

When you’re set with all humility rule changes for the deployment, click Submit; if you navigate away from the tab before submitting the rule changes, they will not be saved.

Fig 9
Figure 10. Add/Save humility rules

Once saved and submitted, DataRobot will monitor the deployment using the new rules along with any previously created ones. After a rule is created, the prediction response body returns the humility object. 

Fig 10 1

Editing Humility Rules

To edit a rule, select the pencil icon for that rule next to the name of the rule. You can change the trigger, action, and any associated values for a rule. When you are finished, click Save changes.

Fig 11
Figure 12. Edit rules

To delete a rule, select the trash can icon for that rule.

To re-order the rules listed, simply drag-and-drop them to the desired order.

Fig 12
Figure 13. Reorder rules

After you have made any of the changes described above, click Submit to finalize your edits (in addition to having selected Save changes after editing a rule). Submit is the only way to permanently save rule changes.

Viewing humility data over time 

After configuring rules and making predictions with humility monitoring enabled, you can view the humility data collected for a deployment from the Humility > Summary tab.

Fig 13
Figure 14. View collected humility data

The X-axis measures the range of time during which predictions have been made for the deployment. The Y-axis measures the number of times humility rules have triggered for the given period of time.

The controls for model version and the data time range selectors work the same as those available on the Data Drift tab.

More Information

DEMO
Deliver Trusted AI with DataRobot AI Platform

The Next Generation of AI

Sign up
About the author
Linda Haviland
Linda Haviland

Community Manager

Meet Linda Haviland
  • Listen to the blog
     
  • Share this post
    Subscribe to DataRobot Blog
    Newsletter Subscription
    Subscribe to our Blog