Quant Memo
Foundational

Winsorising and Clipping Features Before Training

Winsorising caps extreme feature values at a chosen percentile instead of deleting them, keeping outlier data points in the training set while stopping them from dominating a model's fit.

Prerequisites: Outlier Detection and Winsorization

A single data-entry error or a genuine one-off market event can produce a feature value 50 times larger than anything else in the dataset, and most models will happily let that one row dictate the fit. Winsorising handles this by capping values beyond a chosen percentile — say the 1st and 99th — to sit exactly at that percentile, rather than deleting the row (which throws away the rest of its information) or leaving the raw value in (which lets it dominate).

Winsorising caps extreme values at a percentile threshold instead of removing the observation entirely, trading a small amount of information loss at the tails for a model that isn't hostage to a handful of extreme points.

Clipping is the same idea applied with fixed, chosen bounds (e.g., cap any z-score beyond ±3) rather than percentiles computed from the data. Both differ from trimming, which drops the offending rows outright.

Worked example. A feature — daily trading volume growth — has 998 values between -50% and +80%, but one stock had a corporate action producing a reading of +4,000%. Winsorising at the 1st/99th percentile finds that the 99th percentile is +85%, so the +4,000% value is replaced with +85%. The row stays in the training set with its other features intact, but this one feature can no longer swamp the loss function.

The percentile bounds should always be computed only on the training data, and applied unchanged to validation and test sets, to avoid leaking information about the distribution of future data into the training process.

Related concepts

Practice in interviews

Further reading

  • Wilcox, Introduction to Robust Estimation and Hypothesis Testing (ch. 3)
ShareTwitterLinkedIn