1
$\begingroup$

So the standard min max is $$\ \frac{x - \min(x)}{ \max(x) - \min(x)}$$ or something like that.

Given a range like 0 to 500 I would like 250 to normalize to 1, 0 and 500 to 0. What is the proper way to do this? Apologies if this is duplicate, I wasn't sure how to search for the question, because I don't know if this exists and has a name.

$\endgroup$
  • 7
    $\begingroup$ Because there are many solutions possible and no basis for preferring one over the other, please explain why you want to do this and also provide any additional constraints you might like to apply. $\endgroup$ – whuber Aug 6 '15 at 19:19
1
$\begingroup$

Try this... $$ 1-\bigg|\frac{2x-\max(x)-\min(x)}{\max(x)-\min(x)}\bigg| $$

| cite | improve this answer | |
$\endgroup$
1
$\begingroup$
  • First shift the values to range [-250, 250]: $x \mapsto x - 250$
  • Now, scale the values to range [-1, 1]: $x \mapsto \frac{x - 250}{250}$
  • Fit a triangular function [1] on this range: $x \mapsto 1 - \left| \frac{x - 250}{250} \right|$

[1] https://en.wikipedia.org/wiki/Triangular_function

| cite | improve this answer | |
$\endgroup$
1
$\begingroup$

Just normalize to $[0;1]$ as before.

Then scale by 2.

Voila, what used to be 0.5 is now 1.

Now for any value larger than 1, use 2 - x instead.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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