Normalize numerical values
$begingroup$
In a AI course, we have to normalize a set of numerical inputs such that the highest input becomes $1$ and the lowest becomes $0$. The set is as follows:
$ 1\3\5\2 $
So the first entry should become $0$ and the third one becomes $1$.
Now how do I calculate the second and last one? I can't just divide by 5 because dividing one by five would give $0.2$ and not $0$.
machine-learning
$endgroup$
add a comment |
$begingroup$
In a AI course, we have to normalize a set of numerical inputs such that the highest input becomes $1$ and the lowest becomes $0$. The set is as follows:
$ 1\3\5\2 $
So the first entry should become $0$ and the third one becomes $1$.
Now how do I calculate the second and last one? I can't just divide by 5 because dividing one by five would give $0.2$ and not $0$.
machine-learning
$endgroup$
$begingroup$
what's the problem with0.2
?
$endgroup$
– OmG
Jan 26 at 12:46
$begingroup$
the lowest value (here 1) should become $ 0 $
$endgroup$
– Wouter Vandenputte
Jan 26 at 12:48
add a comment |
$begingroup$
In a AI course, we have to normalize a set of numerical inputs such that the highest input becomes $1$ and the lowest becomes $0$. The set is as follows:
$ 1\3\5\2 $
So the first entry should become $0$ and the third one becomes $1$.
Now how do I calculate the second and last one? I can't just divide by 5 because dividing one by five would give $0.2$ and not $0$.
machine-learning
$endgroup$
In a AI course, we have to normalize a set of numerical inputs such that the highest input becomes $1$ and the lowest becomes $0$. The set is as follows:
$ 1\3\5\2 $
So the first entry should become $0$ and the third one becomes $1$.
Now how do I calculate the second and last one? I can't just divide by 5 because dividing one by five would give $0.2$ and not $0$.
machine-learning
machine-learning
edited Jan 26 at 12:49
Wouter Vandenputte
asked Jan 26 at 12:45
Wouter VandenputteWouter Vandenputte
1295
1295
$begingroup$
what's the problem with0.2
?
$endgroup$
– OmG
Jan 26 at 12:46
$begingroup$
the lowest value (here 1) should become $ 0 $
$endgroup$
– Wouter Vandenputte
Jan 26 at 12:48
add a comment |
$begingroup$
what's the problem with0.2
?
$endgroup$
– OmG
Jan 26 at 12:46
$begingroup$
the lowest value (here 1) should become $ 0 $
$endgroup$
– Wouter Vandenputte
Jan 26 at 12:48
$begingroup$
what's the problem with
0.2
?$endgroup$
– OmG
Jan 26 at 12:46
$begingroup$
what's the problem with
0.2
?$endgroup$
– OmG
Jan 26 at 12:46
$begingroup$
the lowest value (here 1) should become $ 0 $
$endgroup$
– Wouter Vandenputte
Jan 26 at 12:48
$begingroup$
the lowest value (here 1) should become $ 0 $
$endgroup$
– Wouter Vandenputte
Jan 26 at 12:48
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
You just need the following formula:
$$frac{x-min}{max-min}$$
Which $min$ and $max$ are the minimum and maximum value in data which is $1$ and $5$ here, respectively.
$endgroup$
add a comment |
$begingroup$
You want to map all the values you have to the interval $[0,1]$ -- that's what's meant by normalise. So, if $A = {1,3,5,2}$ is your set of values, you need the width of $A$, i.e.
$$ w(a) := max_{x in A} x - min{xin A} x $$
Then you need to rebase $A$ to have zero in it. This can be done by subtracting the minimum element from the set. So for each element in the set $A$ you translate and then divide by the width, i.e.
$$ x mapsto frac{x-min_{yin A} y}{w(A)} $$
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3088205%2fnormalize-numerical-values%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You just need the following formula:
$$frac{x-min}{max-min}$$
Which $min$ and $max$ are the minimum and maximum value in data which is $1$ and $5$ here, respectively.
$endgroup$
add a comment |
$begingroup$
You just need the following formula:
$$frac{x-min}{max-min}$$
Which $min$ and $max$ are the minimum and maximum value in data which is $1$ and $5$ here, respectively.
$endgroup$
add a comment |
$begingroup$
You just need the following formula:
$$frac{x-min}{max-min}$$
Which $min$ and $max$ are the minimum and maximum value in data which is $1$ and $5$ here, respectively.
$endgroup$
You just need the following formula:
$$frac{x-min}{max-min}$$
Which $min$ and $max$ are the minimum and maximum value in data which is $1$ and $5$ here, respectively.
answered Jan 26 at 12:51


OmGOmG
2,512824
2,512824
add a comment |
add a comment |
$begingroup$
You want to map all the values you have to the interval $[0,1]$ -- that's what's meant by normalise. So, if $A = {1,3,5,2}$ is your set of values, you need the width of $A$, i.e.
$$ w(a) := max_{x in A} x - min{xin A} x $$
Then you need to rebase $A$ to have zero in it. This can be done by subtracting the minimum element from the set. So for each element in the set $A$ you translate and then divide by the width, i.e.
$$ x mapsto frac{x-min_{yin A} y}{w(A)} $$
$endgroup$
add a comment |
$begingroup$
You want to map all the values you have to the interval $[0,1]$ -- that's what's meant by normalise. So, if $A = {1,3,5,2}$ is your set of values, you need the width of $A$, i.e.
$$ w(a) := max_{x in A} x - min{xin A} x $$
Then you need to rebase $A$ to have zero in it. This can be done by subtracting the minimum element from the set. So for each element in the set $A$ you translate and then divide by the width, i.e.
$$ x mapsto frac{x-min_{yin A} y}{w(A)} $$
$endgroup$
add a comment |
$begingroup$
You want to map all the values you have to the interval $[0,1]$ -- that's what's meant by normalise. So, if $A = {1,3,5,2}$ is your set of values, you need the width of $A$, i.e.
$$ w(a) := max_{x in A} x - min{xin A} x $$
Then you need to rebase $A$ to have zero in it. This can be done by subtracting the minimum element from the set. So for each element in the set $A$ you translate and then divide by the width, i.e.
$$ x mapsto frac{x-min_{yin A} y}{w(A)} $$
$endgroup$
You want to map all the values you have to the interval $[0,1]$ -- that's what's meant by normalise. So, if $A = {1,3,5,2}$ is your set of values, you need the width of $A$, i.e.
$$ w(a) := max_{x in A} x - min{xin A} x $$
Then you need to rebase $A$ to have zero in it. This can be done by subtracting the minimum element from the set. So for each element in the set $A$ you translate and then divide by the width, i.e.
$$ x mapsto frac{x-min_{yin A} y}{w(A)} $$
answered Jan 26 at 12:54
postmortespostmortes
2,21031322
2,21031322
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3088205%2fnormalize-numerical-values%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
what's the problem with
0.2
?$endgroup$
– OmG
Jan 26 at 12:46
$begingroup$
the lowest value (here 1) should become $ 0 $
$endgroup$
– Wouter Vandenputte
Jan 26 at 12:48