-
Notifications
You must be signed in to change notification settings - Fork 0
/
neural_network_classification_Test.m
36 lines (35 loc) · 1.53 KB
/
neural_network_classification_Test.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function [Category,Category_cost,Category_output]=neural_network_classification_Test(Features)
%Features= allfeatures_extraction( wav_file );
MFile= load('nnmodels'); %File= load('speech');
%Tr_categories=MFile.NNTr_categories;
%Tr_emotions=MFile.NNTr_emotions;
%[rn,col]=find(strcmp(File.features,Features));
%targets1=transpose(File.categories_nn(col,:));
%targets2=transpose(File.emotions_nn(col,:));
%==================Speech Disorder======================================%
%==================Speech Disorder======================================%
% Test the Network
Features=transpose(Features);
Category_output=MFile.NNStruct_categories(Features);
%Category_errors = gsubtract(targets1,Category_output);
%performance1 = perform(MFile.NNStruct_categories,targets1(1),Category_output);
%performance2 = perform(MFile.NNStruct_categories,targets1(2),Category_output);
%Category_performance= max([performance1,performance2]);
%Category_error=min(Category_errors);
A=max(Category_output);
if A==Category_output(1)
Category={'Infected'};
Category_cost=[1,0];
end
if A==Category_output(2)
Category={'Normal'};
Category_cost=[0,1];
end
% Plots
% Uncomment these lines to enable various plots.
% figure, plotperform(tr)
% figure, plottrainstate(tr)
%figure, plotconfusion(targets1,Category_output)
%figure, ploterrhist(Category_errors)
%Categories_errors = gsubtract(targets,frequency_categories_outputs);
%Categories_performance = perform(MFile.NNStruct_frequency_categories,targets,frequency_categories_outputs);