liveBook · Manning

Stacked ensemble

As explained in Outlier Detection in Python

A predictive model that learns from the outputs of multiple component models or detectors, often using those outputs as input features.

A stacked ensemble combines scores from multiple outlier detectors with a classifier that learns a final outlier prediction or score. Unlike fixed weighting, it can account for detector correlations and cases where detectors succeed or fail differently. section 14.6.5

Build a stacked ensemble by:

  • Combining the score columns with ground-truth, hand-labeled, or pseudo-label data. section 14.6.5 section 15.4.1
  • Training a classifier, such as a Random Forest, and using its positive-class probability as the final outlier score. section 14.6.5
  • Cross-validating the model and checking that examples from both classes represent real data. section 14.6.5 section 15.4.1

Labeled detector scores

Create a dataframe containing detector scores and a Label column, then fit a Random Forest classifier to predict whether each record is of interest. Binary labels are supported; graded relevance scores are preferred. section 15.4.1

How Outlier Detection in Python covers it

How deep it goes
Explains score preparation, classifier training, probability scoring, cross-validation, and representative-label limitations without deriving classifier internals.
Examples
Uses detector-score dataframes, ground-truth or hand labels, synthetic data, pseudo labels, and Random Forest probability predictions.
What it assumes
Assumes multiple detector scores and some labels, while allowing unexamined records to default to inliers and recommending synthetic data.
What you can do after
Build it from scratch with detector scores and labels, then evaluate the classifier and use predicted probabilities as outlier scores.
How it connects
Connects outlier detection with classifiers, Random Forests, semisupervised learning, pseudo labels, and cross-validation.

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.