Min-Max vs Robust Scaling

easy
Unit 4 · Pandas I0/3 to milestone

Feature scaling choices matter when there are outliers. One extreme value squashes min-max scaling, while robust scaling (median and IQR) barely notices it.

Implement column-wise with NumPy:

  • minmax_fit(X) → (mins, ranges), where a range of 0 becomes 1
  • minmax_transform(X, params, clip=False): (X - min) / range, clipped to [0, 1] if clip
  • robust_fit(X) → (medians, iqrs), using np.percentile 25 and 75, where an IQR of 0 becomes 1
  • robust_transform(X, params): (X - median) / iqr
#preprocessing#outliers#numpy2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Min-Max vs Robust Scaling · TechGradify