liveBook · Manning

Manual evaluation

As explained in Outlier Detection in Python

Manual inspection is the direct review of individual data records or flagged observations to identify errors, categories, or meaningful patterns.

Manual evaluation directly reviews individual records flagged by outlier detectors to decide which are relevant, identify categories, and find meaningful patterns. It converts imperfect detector output into labels or pseudo-ground truth rather than treating every statistically unusual record as important. section 14.4 section 15.2.1

A practical evaluation workflow is:

  • Run diverse detectors with different preprocessing and parameters. section 14.4.1
  • Collect records flagged by at least one detector, remove duplicates, and inspect the resulting superset. section 14.4.1
  • Check records just below detector thresholds because ensembles may reveal mildly unusual records missed by individual detectors. section 14.4.1
  • Label relevant outliers consistently, add useful categories, and tune the system to score them above other records. section 14.4.1 section 15.5

Inspection can reveal simple univariate explanations or more complex patterns spanning multiple features. It also exposes false positives: many statistically unusual records may be irrelevant, while newly flagged or unlabeled records require judgment before they enter evaluation data. section 15.2.1 section 15.5

Isolation Forest and error-rate patterns

After fitting an Isolation Forest to encoded KDD Cup data, sort records by score and inspect the highest-scored rows. Repeatedly high destination-host error rates can motivate an outlier category, while other features may reveal additional or more complex categories. section 15.2 section 15.2.1

Listing 14.6 Collecting a superset of high-scored records
def get_top_scored(df, scores_col):
    cutoff = sorted(df[scores_col])[-10]
    return scores_df[scores_df[scores_col] >= cutoff].index.tolist()
 
scores_cols = set(scores_df.columns) - set(df.columns)          #1
top_rows = []
for scores_col in scores_cols:
    res = get_top_scored(scores_df, scores_col)                 #2
    top_rows.extend(res)
top_rows = list(set(top_rows))                                  #3

Shows how to collect the union of top-scored records from multiple detector columns and remove duplicates before manual review. section 14.4.1

How Outlier Detection in Python covers it

How deep it goes
Defines a multi-step inspection workflow and interpretation practice, but stops short of fully automating category assignment.
Examples
Uses detector-score supersets, KDD Cup records, Isolation Forest rankings, and destination-host error-rate features.
What it assumes
Assumes detector scores and flagged records exist, while teaching how to inspect them and distinguish relevant from irrelevant outliers.
What you can do after
Diagnose/debug with it by validating flagged records, assigning consistent labels, and improving detector thresholds or ensembles.
How it connects
Connects outlier detection with pseudo-ground truth, ensemble methods, clustering, association rules, and regression testing.

Also explained in

Compare how 3 books explain manual evaluation →

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.