Normalize data around a specific value

28 Views Asked by At

I am having trouble to solve a problem about normalization around a specific value. Let's say i have this data below:

ValueA ValueB Division (A/B) Gap (Division - 0.625)
10 10 1 0.375
10 16 0.625 0
15000 1 15000 14999.375
1 15000 0 -0.62499

My perfect fit is when i have valueA / valueB is equal to 0.625 (i want to have valueB, 1.6 time greater than valueA). So my second row is my best case and the gap is calculated based on this value (Division - 0,625).

Now my problem is that i can't normalize my values around this specific value. I would like to keep 0 for when my gap is equal to 0, 1 for the biggest gap above (here, 14999) and -1 for the biggest gap under (here -0,624). I tried to use normalization methods like:

zi = 2 * ((xi – xmin) / (xmax – xmin)) – 1

or to center and reduce (with mean and std) my gap but none of them is working (my gap 0 is not 0 anymore and becomes some random value).

Has anyone any idea how to solve this? I would like to make my gaps on the same scale to be able to compare them.

Thanks