how to create exe file from NN toolbox trained network for testing on new data inputs
5 views (last 30 days)
Show older comments
Hi all I created a NN using NNtoolbox to predict company failure, but now I want to create it as EXE for further analysis for new dataset so third users can use it can anyone tell me how to do that? and how to test the NN for predicating failure with using inputs of a new dataset here the code generated
if true
% Solve a Pattern Recognition Problem with a Neural Network
% Script generated by Neural Pattern Recognition app
% Created 28-May-2016 22:38:23
%
% This script assumes these variables are defined:
%
% inou - input data.
% out - target data.
x = inou';
t = out';
% Choose a Training Function
% For a list of all training functions type: help nntrain
% 'trainlm' is usually fastest.
% 'trainbr' takes longer but may be better for challenging problems.
% 'trainscg' uses less memory. Suitable in low memory situations.
trainFcn = 'trainscg'; % Scaled conjugate gradient backpropagation.
% Create a Pattern Recognition Network
hiddenLayerSize = 10;
net = patternnet(hiddenLayerSize);
% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
% Train the Network
[net,tr] = train(net,x,t);
% Test the Network
y = net(x);
e = gsubtract(t,y);
performance = perform(net,t,y)
tind = vec2ind(t);
yind = vec2ind(y);
percentErrors = sum(tind ~= yind)/numel(tind);
% View the Network
view(net)
end
Answers (1)
Greg Heath
on 28 May 2016
% To save
save net1;
% To use on new data in another program or from the command line
load net1
newoutput = net1(newinput);
Hope this helps.
Thank you for formally accepting my answer
Greg
0 Comments
See Also
Categories
Find more on Sequence and Numeric Feature Data Workflows 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!