Solved – How to normalize if MAD equals zero

madmediannormalization

A known way to normalize our feature vectors is:

$$\frac{x_i – \operatorname{median}( X^{(j)})}{\operatorname{MAD}^{(j)}},$$

where $\operatorname{MAD}^{(j)}$ is the median absolute deviation of feature $j$.

However, if more than $50\%$ of a feature vector's data have the same value, we have: $\operatorname{MAD}^{(j)}=0$.

Is there an appropriate approach to handle this problem? Or, should I just use another method?

Best Answer

If at least 50% of your observations are identical then yes, this normalisation operation wouldn’t make sense mathematically as well as intuitively.

I would probably consider binning the observations as suggested before. For instance, all observations with the same value will be labelled group 1 and everything else group 2.

That being said, if you really want to maintain the numerical nature of the feature then you could try various transformations first (such as the log, square root etc) to minimise the effect of the outliers and then normalise using the traditional methods.