How can i unnormalize the forecasted system load outputs in Neural Networks in Matlab

4 views (last 30 days)
I normalised and unnormalised training and test data as mentioned below and hwo can i unnormalise the forecased output to the scale of test data ?
% normalising training and test data
[pn,ps] = mapminmax(input_train);
[tn,ts] = mapminmax(target_train);
[pn1,ps1] = mapminmax(input_test);
[tn1,ts1] = mapminmax(target_test);
forecastedoutput=net(pn1);
an = sim(net,pn);
a = mapminmax('reverse',an,ts);

Answers (1)

Srivardhan Gadila
Srivardhan Gadila on 31 Oct 2020
It is recommended to normalize the entire dataset first and then split it for training and testing so that the normalization would be consistent.
Or use the same normalization settings which are used for training data to normalize the testing data:
% normalising training data
[pn,ps] = mapminmax(input_train);
[tn,ts] = mapminmax(target_train);
% normalize test data with settings used for normalizing the training data
pn1 = mapminmax('apply',input_test,ps);
tn1 = mapminmax('apply',target_test,ts);
an = sim(net,pn1);
a = mapminmax('reverse',an,ts);
Refer to the documentation of Normalize Inputs and Targets Using mapminmax & sim

Community Treasure Hunt

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

Start Hunting!