liveBook · Manning

Importance score

As explained in Outlier Detection in Python

A numeric value representing the significance or urgency assigned to an outlier based on applicable explanations or categories.

An importance score is a numeric value that ranks how significant or urgent a flagged outlier is. It complements a category explaining why the record was flagged and reflects project relevance rather than statistical unusualness alone. section 15.1 section 15.3.1

Rule-based scoring can proceed by:

  • Assigning explanations when measurable conditions apply, such as unusually long sessions or high error rates. section 15.3.1
  • Adding a numeric weight for each applicable category, either by counting known anomalies or using category-specific importance values. section 15.3.1
  • Testing the rules on flagged records and borderline or highly scored records before using them to sort future investigations. section 15.3.1
Listing 15.6 Sorting outliers detected in KDD Cup dataset
top_scored_df = df[df['IF Scores'] > 0.1].copy()
top_scored_df['Total Errors'] = top_scored_df[error_cols].sum(axis=1)
 
top_scored_df['Label'] = 'Unknown'
top_scored_df['Importance'] = 0
for i in top_scored_df.index:
    row = top_scored_df.loc[i]
    expl = ''
    importance = 0
    if row['duration'] > 1500:
        expl += "Unusually long sessions. "
        importance += 1
    if row['Total Errors'] > 200:
        expl += "Unusually high error rates. "
        importance += 2  
    if len(expl):   
        top_scored_df.loc[i, 'Label'] = expl
        top_scored_df.loc[i, 'Importance'] = importance 

The listing demonstrates assigning explanations and accumulating importance for detected records using duration and total-error thresholds. section 15.3.1

How Outlier Detection in Python covers it

How deep it goes
Defines additive and category-weighted scoring, then stops short of prescribing universally reliable thresholds or complete coverage.
Examples
Uses long-session and high-error-rate rules on KDD Cup detector outputs, with category weights contributing to each record’s score.
What it assumes
Assumes detector outputs and domain knowledge for defining relevant categories, while treating statistical unusualness as insufficient by itself.
What you can do after
Apply it via rule-based sorting to prioritize investigations and identify why an outlier was flagged.
How it connects
Connects outlier detection with anomaly categories, domain expertise, explainability, and investigation prioritization.

Related concepts

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.