필터 지우기
필터 지우기

I have problem in min and max normalization

조회 수: 41 (최근 30일)
abduall hassn
abduall hassn 2016년 8월 25일
댓글: Adam 2016년 8월 25일
p=[148
249
357
547
854
1
1184
996
966
679
586
503
281
1
110
89
58
68
28
19
16
6
13
7
4
2
1
12]
I used min and max normalization this code
mindata = min(min(P));
maxdata = max(max(P));
normalised = ((P-mindata)/((maxdata)-mindata));
display(normalised);
In my data i has value of 1 when i applied this approach the value of one normalized as 0 idnt like to be 0. idnt know this code is correct. I want the normalization between 0 and 1
How i can solve this problem?
  댓글 수: 2
Guillaume
Guillaume 2016년 8월 25일
min/max normalisation is rescaling the values in your array so that the minimum value (1 in your case) becomes 0 and the maximum becomes 1.
If you don't like it, then don't do it or do something else (or come up with your own maths: that's math for you, if you subtract 1 from 1, you get 0).
Adam
Adam 2016년 8월 25일
If you want 1 to map to something positive then you can just get rid of the min part of the maths and assume the min of your data is 0. But on arbitrary data that will potentially leave a significant portion of your 0-1 output range unused and the data squashed into the rest of it.

댓글을 달려면 로그인하십시오.

답변 (2개)

KSSV
KSSV 2016년 8월 25일
clc; clear all ;
p=[148 249 357 547 854 1 1184 996 966 679 586 503 281 1 110 89 58 68 28 19 16 6 13 7 4 2 1 12] ;
n = (p-min(p))./(max(p)-min(p)) ; % normalizing the data p
I have used:
ni = (pi-min(p))/(max(p)-min(p))
  댓글 수: 4
abduall hassn
abduall hassn 2016년 8월 25일
Dear Guillaume
Please, can you suggest me and another approach which we can show the normalization value in positive. Thank u
Adam
Adam 2016년 8월 25일
What do you want 1 to be? It is easy to come up with a mathematical formula if you know what you want your min and max values to map to and you know you want a linear scaling.

댓글을 달려면 로그인하십시오.


KSSV
KSSV 2016년 8월 25일
Dear friend....
Just think... minimum value in p is 1...if you subtract p with min(p), wont it be zero?
By the way ni = (pi-min(p))/(max(p)-min(p)) is to show up for one element...and n = (p-min(p))/(max(p)-min(p)) this is for complete array...

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by