normalising and reverse normalising data
10 views (last 30 days)
Show older comments
For forecasting , I normalised the data before training for test and train data , then when i plot the rmse , i get rmse 0.2.but when i try to reverse the normalised values to match with orginal target of test data it shows high error.
i have used below code to normalise and denormalise :
[pn,ps] = mapminmax(XTrain);
[tn,ts] = mapminmax(YTrain);
[qn,qs] = mapminmax(XTest);
[rn,rs] = mapminmax(YTest);
net = trainNetwork(pn,tn,layers,options);
YPred=predict(net,qn);
YPred1 = mapminmax('reverse',YPred,ts);
what could be the reason ?
3 Comments
Answers (1)
Karan Nandankar
on 28 Dec 2020
Hi,
Looks like you have used the wrong Process Settings in the variable 'YPred1'. As I can see you are using XTest as your independent variable for Model Prediction, and the corresponding dependent variable YTest is normalized with Process Setting parameter 'rs'. However, for the variable YPred1 you have mapped the predictions against 'ts' (which is for YTrain).
In order to reverse the normalization, you can change the Process Setting parameter in YPred1 from 'ts' to 'rs'.
YPred1 = mapminmax('reverse',YPred,rs);
0 Comments
See Also
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!