-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathneural_network_classification.m
35 lines (33 loc) · 1.43 KB
/
neural_network_classification.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
function [Category,Category_cost,Category_output,Category_Error]=neural_network_classification(wav_file)
Features= allfeatures_extraction( wav_file );
MFile= load('nnmodels'); File= load('skindata');
%Tr_categories=MFile.NNTr_categories;
%Tr_emotions=MFile.NNTr_emotions;
[rn,col]=find(strcmp(File.FilePath,wav_file));
%targets1=transpose(File.categories_nn(col,:));
%==================Speech Disorder======================================%
% Test the Network
Features=transpose(Features);
Category_output=MFile.NNStruct_categories(Features);
%Category_errors = gsubtract(targets1,Category_output);
%Category_performance = perform(MFile.NNStruct_categories,targets1,Category_output);
%Category_performance= perform(MFile.NNStruct_categories,targets1(2),Category_output);
%Category_performance= max([performance1,performance2]);
A=max(Category_output);
Category_Error=1-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);