Filter löschen
Filter löschen

How to test NARX network on data without givin the test target

2 Ansichten (letzte 30 Tage)
moncef soualhi
moncef soualhi am 2 Dez. 2019
I have a time series NARX neural network that is already trained .
%Training data
X_tr = XTrain;
T_tr = YTrain;
%Prepare the structure of the data for training the model
[Train_x,xi_tr,ai_tr,t_tr] = preparets(net,X_tr,{},T_tr);
%Setting parameters of the model
net.divideParam.trainRatio = 80/100;
net.divideParam.valRatio = 20/100;
net.divideParam.testRatio = 0/100;
net.trainParam.epochs = 100;
net.trainParam.max_fail = 25;
net.performFcn = 'mae';
%Training the model
[net,tr] = train(net,Train_x,t_tr,xi_tr,ai_tr,'useParallel','yes','showResources','yes');
Now I would like to take the trained network and then input a new set of data (test set), and get a time series prediction output.
%Testing data
X_ts = XTest;
T_ts = YTest;
% remove the delay in purpuse to use the y(t) to predict the y(t+1)
nets = removedelay(net);
nets.name = [net.name ' - Predict One Step Ahead'];
%Prepare the structure of the data for testing the model
[Test_x,xi_ts,ai_ts,t_ts] = preparets(nets,X_ts,{},T_ts);
%Test the model on the test set
ys = nets(Test_x,xi_ts,ai_ts);
stepAheadPerformance = perform(nets,t_ts,ys);
Here, it seems from the documentation that the target series (t_ts in this example) is required for the test. However, in reality and real time, we don't have the real target, we have to inject the test data and have an output directly.
With this structure the predictions are excellent and well fitted. However, I tried to set the t_ts(1:end) = [0] and the prediction is completly diverging.
Is there a solution to overcome this problem or an interpretaion of this problem?
Thanks

Antworten (0)

Kategorien

Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by