I have a df with many features that take both negative and positive values.For example a feature may have values in range (-10 , 10).For each feature which has negative values the negative sign means direction and this -10 is actually a larger value than - 5.
After finilizing my model i tried many scaling techniques such as Minmaxscaler from (0,1) and mean max scaler from (-1,1),robust scaler,standarization and found the minmaxscaler from (0,1) has the best results.
My concern is this:
Scaling the data with this technique does not account for the true meaning of my feature as seen belo and -2 will be smaller than -1 after scaling to (0,1).
Is there a way to enforce this rule(negative means only direction) during my scaling process?
Asked
Active
Viewed 56 times
3

Epitheoritis 32
- 157
- 4
2 Answers
2
Peculiar to your case, you can scale the absolute values of your features, and then apply your directions, i.e. some sort of magnitude scaling, though I'm not sure it'll provide you performance uplift. In addition, don't expect properties like zero mean, unit variance etc. after performing the scaling this way.

gunes
- 49,700
- 3
- 39
- 75
-
I got the first part,but i can't understand how direction would be applied by magnitude scaling.Could you explain a bit more? – Epitheoritis 32 Oct 01 '21 at 09:07
-
1I meant just applying the signs after the scaling – gunes Oct 01 '21 at 09:26
1
You could distinguish direction and magnitude by re-expressing the two components of your data format.
- $| x |$ captures magnitude, reflecting that $-10$ is "larger" than $-5$.
- the sign $\text{sgn}(x)$ captures directing, with $+1$ indicating one direction and $-1$ the opposite.
This will double the number of features you have, which might not be desirable.

Sycorax
- 76,417
- 20
- 189
- 313