Artificial Neural Network's input NORMALIZATION

4 次查看(过去 30 天)
hi every one,
I have a question regarding the normalization of kind of data I have. I have two sets of data to the ANN, training data and testing data. Both of them are having 5 data points at each input.
Training data looks like:
4.04174435161 0.00572348 -0.0153630110827 0.602838009364 -2.36559733245
3.03056109866 0.0662695 -0.0533391771878 0.55923481044 -1.91116449019
2.52071323312 0.121233 0.260306969065 0.467349509343 -1.70735726533
Testing set looks like:
2.33842672041 -0.137656 -0.0597465187944 0.448352030836 -1.00431677993
3.96620615784 0.0438668 0.219515113659 0.596424503954 -2.0851352013
1.99407739363 0.100512 0.360384341206 0.385154801184 -1.18594026984
I would like to know the way to normalize these inputs before feeding to the ANN.
Cheers Mahdi

回答(1 个)

Hoda abuzied
Hoda abuzied 2011-9-25
hi, mahdi you can normalize any data before feeding them to the network by using mapminmax command...it normalizes data so that they would fall in the range of -1 & 1(defaults values)...to do this follow the steps below:
>> i_p_data=[4.04174435161 0.00572348 -0.0153630110827 0.602838009364 -2.36559733245;
3.03056109866 0.0662695 -0.0533391771878 0.55923481044 -1.91116449019;
2.52071323312 0.121233 0.260306969065 0.467349509343 -1.70735726533]; % i just put your data in a vector and gave it a name for simplicity.
>> [nomalized_i_p,ps1]=mapminmax(i_p_data);
>> test_data=[2.33842672041 -0.137656 -0.0597465187944 0.448352030836 -1.00431677993;
3.96620615784 0.0438668 0.219515113659 0.596424503954 -2.0851352013;
1.99407739363 0.100512 0.360384341206 0.385154801184 -1.18594026984];
>>[normalized_test,ps2]=mapminmax(test_data);
>> however, if you want to set them back to their original values i.e. denormalize them :
>> training_data=mapminmax('reverse',normalized_i_p,'ps1');
>> test_data1=mapminmax('reverse',normalized_test,'ps2');
you might also, want to check this for further details
i hope this was helpful.
yours,
hoda
  2 个评论
Walter Roberson
Walter Roberson 2011-9-25
The documentation suggests that 'ps1' and 'ps2' should not be quoted in the reverse mapping call ?
primrose khaleed
primrose khaleed 2014-6-18
hi ...i used this method to normlization the input and testing data in neural network...but when apply this method the testing data dont change..why??? plz help me

请先登录,再进行评论。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by