liveBook · Manning

Rank transformation

As explained in Outlier Detection in Python

A rank transformation replaces numerical values with their order ranks while preserving ordering and altering distances between values.

A rank transformation replaces each detector score with its order among the records. It preserves which records score higher while changing the distances between scores. section 14.5.5

Use rank transformation when detector score scales or distributions are difficult to compare:

  • It gives detectors the same rank-based scale and effectively equalizes score spacing. section 14.5.5
  • It is useful when one detector produces extreme scores or when score gaps have inconsistent meanings. section 14.5.5
  • It discards information about the original size of score gaps, retaining only relative order. section 14.5.5
Figure 14.3 Left pane: examples of a set of high scores produced by three detectors, A, B, and C. Right pane: the same scores after applying rank ordering. The scores are now evenly spaced for each detector.

Compare uneven high-score gaps from several detectors with their evenly spaced rank-ordered forms. section 14.5.5

How Outlier Detection in Python covers it

How deep it goes
Defines order-based rescaling and its trade-offs, but does not develop a full ranking algorithm or tie-handling procedure.
Examples
Uses high-score comparisons across detectors and rank plots contrasting Isolation Forest with Elliptic Envelope.
What it assumes
Assumes multiple detector scores and distinguishes their ordering from their numerical gaps.
What you can do after
Apply rank ordering to make heterogeneous detector scores more comparable before combining them.
How it connects
Connects ranking with outlier detectors, score scaling, score distributions, and ensemble combination.

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.