0
$\begingroup$

I want to rescale the features of my data to be between [0,1] and [-1,1]? Is their a clear cut way that works every time for these ranges? I think the below equation works for [0,1] but when it is describe people say generally it works, so I am not certain it works every single time.

enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

What you said is right, the above equation is for normalizing the data with-in the range of [0,1]

Now, we can generalize using the below equation

To normalize in $[-1,1]$ you can use:

$$ x'' = 2\frac{x - \min{x}}{\max{x} - \min{x}} - 1 $$

In general, you can always get a new variable $x'''$ in $[a,b]$:

$$ x''' = (b-a)\frac{x - \min{x}}{\max{x} - \min{x}} + a $$

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.