matlabmsenntool

How to get "mse" after "newfit" training from MATLAB command line


I have below code

trainData = [11x293 matrix consist of double values];
trainTarget = [3x293 matrix consist of binary values];
testData = [11x32 matrix consist of double values];
trainTarget = [3x32 matrix consist of binary values];

net = newfit(trainData,trainTarget,{20});
net = train(net,trainData,trainTarget);
predicted = sim(net,testData);
% predicted matrix is consist of double values as prediction of trained network

I want to access Mean Squered Error (MSE), which generated after network training, from MATLAB command line. If there is not a direct code to access MSE, I need an algorithm to calculate it.

Thanks in advance.


Solution

  • Since I cannot comment I'll write an answer:

    This question has been answered here

    How to get neural network parameter after training?

    although it is not marked as such. So, now we're waiting for a moderator to remove this question as a duplicate. Also, using newfit() is not recommended since it has been obsoleted in R2010b NNET 7.0.