Normalization – How to Normalize Data Between 0 and 1

datasetnormalization

I have seen the min-max normalization formula in several answers (e.g. [1], [2], [3]), where data is normalized into the interval $\left[0,1 \right]$.

However, is there a method to normalize data into the interval $\left(0,1 \right)$, i.e. excluding 0 and 1?

EDIT:

My data is a sample from a uniform distribution within the range $\left[a,b \right]$. I would like to normalize it into the interval $\left(0,1 \right)$ while remaining uniformly distributed.

Best Answer

Using the property that the CDF is uniformly distributed on $[0,1]$, you can compute the empirical CDF for $x$. This is essentially the same as ranking the data and then rescaling by the number of elements $n$. To enforce the requirement that the scaled data exclude 0 and 1, you can deviate from the standard ECDF procedure and construct the scale so that the outputs are $\frac{1}{n+1}, \frac{2}{n+1},\cdots, \frac{n}{n+1}$, which is likewise uniform.