How to standardize data by the following example:
+---------------+-------+--------+
| comments | input | output |
+---------------+-------+--------+
| min | 1 | -1 |
| chosen middle | 2 | 0 |
| | 3 | |
| | 4 | |
| max | 5 | 1 |
+---------------+-------+--------+
So we know the min, max values of input and we arbitrary choose "middle". The middle will become 0 in output. Min and max will become -1 and +1 respectively.
I want this to visualize temperature on the map with three different colors.
Update after comments.
The most desired solution would be a single uniform function for all the range [min, max] with three control parameters:
f(min, middle, max)
The constrains are:
- the result of the function never goes beyond [-1, +1] range,
- function is monotonous, always increasing from min to max.
Something like cubic spline curve (it is just an example).