Feature engineering and preprocessing · insight-1113
Expect out-of-range values after min-max scaling and decide between clipping and alerting
- Evidence type
- documented fact
- Difficulty
- easy
- Roles
- ML engineer, Data scientist
- Industries
- cross-industry
Summary: situation, action, reason, boundary
Situation
Inputs are min-max scaled for a neural network or linear model, and serving data includes values beyond the training minimum or maximum.
Action
Decide explicitly: set clip=True and log how often it fires, or alert on out-of-range inputs; take the range from robust quantiles when one extreme controls the maximum.
Reason
Minimum and maximum come from fit data, so the scaler does not damp outliers and new extremes fall outside 0 to 1; clipping bounds the output but does not repair a distribution shift.
Boundary
MinMaxScaler in front of gradient-trained models and bounded-input components.
Symptom or risk
Scaled values land outside the 0 to 1 range and saturate activations, or one training extreme sets the maximum and squeezes the bulk of the data into a narrow band.
Exceptions
Features with natural fixed bounds, such as a percentage, where the range can be written down.
Trade-offs
Clipping hides real shift unless its rate is monitored, and inverse transform cannot restore clipped values.
Pitfalls
Turning on clipping and then reading a flat metric as proof that the data did not drift.
Lessons and concepts
Claims and their sources
MinMaxScaler does not reduce the effect of outliers; clip=True clips transformed held-out values to the feature range but does not prevent feature drift.