How to use "nprtool" for testing multiple data ?

2 次查看(过去 30 天)
dear sir,
i am using neural classification tool "nprtool". i have 500 training data and using that once the network is trained i want to test four different data sets for the same training.
i have gone through the webnire of nprtool, i could understand how to use it. but couldnt undersatnd how to test multiple data with same trained network.
i am new to neural networks. please help me for the same.
- Chirag
  1 个评论
Greg Heath
Greg Heath 2015-12-20
Comment by Ashfak Shaikh about 20 hours ago
Even i also facing same problem, plz help

请先登录,再进行评论。

回答(1 个)

harjeet singh
harjeet singh 2015-12-20
hello chirag
i used 500 samples to train nprtool with 4 features, category 1 have code [0;1] and category 2 have code [1;0];
after training i randomly take a sample having 4 features and fed to trained NN. if NN outputs are [0;1] it belongs to category 1 otherwise at [1;0] category 2.
%////////// nn training //////////////////////////////
inputs=randint(4,500,[1 10]);
outputs=randint(2,500,[0 1]);
hiddenLayerSize = 10;
net = patternnet(hiddenLayerSize);
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
[net,tr] = trainrp(net,inputs,outputs);
%///////////////// nn testing //////////////////////////
input=[2;3;5;6];
nn_output=round(net(input));
if(nn_output==[0;1])
display('category 1');
end
if(nn_output==[1;0])
display('category 2');
end

类别

Help CenterFile Exchange 中查找有关 Pattern Recognition and Classification 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by