Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Denormalization of predicted data in neural networks

In Neural Networks, the number of samples used for training data is 5000 and before the data is given for training it was normalized using the formula

     y - mean(y)
y' = -----------
      stdev(y)

Now I want to de-normalise the data after getting the predicted output. Generally for prediction a test data data is used which is 2000 samples. In order to de-normalize, following formula is used

y = y' * stdev(y) + mean(y)

This approach is taken from the following thread [How to denormalise (de-standardise) neural net predictions after normalising input data

Could anyone explain me how the same mean and standard deviation used in normalizing the training data(5000*2100) could be used in de-normalizing the predicted data as you know for prediction test data(2000*2100) is used,both the counts are different.

like image 470
Vinod Prime Avatar asked Oct 01 '15 12:10

Vinod Prime


Video Answer


1 Answers

The denormalization equation is simple algebra: it's the same equation as normalization, but solved for y instead of y'. The function is to reverse the normalization process, recovering the "shape" of the original data; that's why you have to use the original stdev and mean.

Normalization is a process of shifting the data to center on 0 (using the mean), and then squeezing the distribution to a standard normal curve (for a new stdev of 1.0). To return to the original shape, you have to un-shift and un-squeeze the same amounts as the original distribution.

Note that we expect the predicted data to have a mean of 0 and a stdev around 1.0 (with some change in variations due to the central tendency theorem). Your worry is not silly: we do have a different population count for the stdev.

like image 122
Prune Avatar answered Oct 09 '22 00:10

Prune