Skip to main content

apply_prob_complement

Function apply_prob_complement 

Source
pub fn apply_prob_complement(
    batches: Vec<RecordBatch>,
    neg_facts: &[RecordBatch],
    left_col: &str,
    right_col: &str,
    prob_col: &str,
    complement_col_name: &str,
) -> Result<Vec<RecordBatch>>
Expand description

Probabilistic complement for negated IS-refs targeting PROB rules.

Instead of filtering out matching VIDs (anti-join), this adds a complement column __prob_complement_{rule_name} with value 1 - p for each matching VID, and 1.0 for VIDs not present in the negated rule’s facts. Implements IS NOT risk on a PROB rule: the probability that the entity is NOT risky.