liveBook · Manning

PRISM

As explained in Outlier Detection in Python

A rule-discovery algorithm that constructs ordered class-specific rules according to coverage and support criteria.

PRISM discovers readable rules that can act as a proxy for an outlier detector. It produces separate ordered rules for inliers and outliers, using feature conditions to describe the detector’s labels rather than treating those labels as verified anomalies. section 13.2.2

Within each class, earlier rules cover more matching rows; later rules address rows still unexplained. A row is explained by the first rule it matches. Configurable minimum support and coverage filter the rules displayed. Numeric features can be divided into three bins before rule generation. As with decision-tree proxies, useful explanations may warrant investigation without capturing every relevant reason for a prediction. section 13.2.2

Explaining detector labels

An Isolation Forest score is converted to a binary label, then PrismRules generates rules from the original features and that label. One displayed inlier rule, “Height = Med,” matches 1,449 of 4,073 inlier rows; all 1,449 matching rows have the inlier label. section 13.2.2

Target: False
Height = Med
   Support:  The target has value: 'False' for 100.000% of the 1449 rows
             matching the rule 
   Coverage: The rule matches: 1449 out of 4073 rows for target value: 
             'False'. This is:
      35.576% of total rows for target value: 'False'
      34.690% of total rows in data
 
Shucked_weight = Med
   Support:  The target has value: 'False' for 100.000% of the 552
             remaining rows matching the rule
   Coverage: The rule matches: 552 out of 2624 rows remaining for target 
             value: 'False'. This is:
      21.037% of remaining rows for target value: 'False'
      13.553% of total rows for target value: 'False'
      13.215% of total rows in data
 
Shell_weight = Med
   Support:  The target has value: 'False' for 100.000% of the 127 
             remaining rows matching the rule
   Coverage: The rule matches: 127 out of 2072 rows remaining for target
             value: 'False'. This is:
      6.129% of remaining rows for target value: 'False'
      3.118% of total rows for target value: 'False'
      3.040% of total rows in data

Inspect the rule output to distinguish support among matching rows from coverage of the target class, including rows remaining after earlier rules. section 13.2.2

How Outlier Detection in Python covers it

How deep it goes
Explains rule ordering, first-match assignment, support, coverage, and binning, but does not detail the rule-search algorithm.
Examples
Shows Python rule generation from binary Isolation Forest labels and tabulated support and coverage for resulting rules.
What it assumes
Assumes a feature table and detector labels while showing how to derive binary labels from Isolation Forest scores.
What you can do after
Apply it via PrismRules to inspect feature rules associated with a detector’s inlier and outlier labels.
How it connects
Connects rule discovery to proxy models, decision trees, Isolation Forest, and explainable outlier detection.

This explainer was generated by Manning's knowledge graph from the text of Outlier Detection in Python. The section links point to the parts of the book it draws on.