Skip to content
ML Academy

Feature engineering and preprocessing · insight-0132

Take clipping limits from training-fold quantiles and record them as model parameters

Evidence type
practitioner heuristic
Difficulty
easy
Roles
Data scientist, ML engineer
Industries
aviation, finance

Summary: situation, action, reason, boundary

  1. Situation

    You winsorize heavy-tailed features or targets to limit the influence of extremes.

  2. Action

    Fit clip limits on the training fold only, store them with the pipeline, apply them unchanged at serving, and log how often serving values hit the limits.

  3. Reason

    Clip limits are learned parameters like a scaler's mean; treating them as constants keeps evaluation honest and serving stable.

  4. Boundary

    Linear and distance models, squared-error losses and any feature with rare extreme values.

Symptom or risk

Limits computed on the full dataset leak test information; limits recomputed at serving time drift with each batch.

Exceptions

Physical bounds (load factor between 0 and 1) can be hard-coded because they come from definitions, not data.

Trade-offs

Clipping reduces variance but biases predictions for genuinely extreme cases; check errors on the clipped rows.

Pitfalls

Clipping the target in evaluation as well as training, which hides exactly the errors the business may care about.

Example

Synthetic raw airline data contains six load_factor values above 1: those are integrity errors to fix, not values to clip.

Lessons and concepts