function [ outputmat ] = ComputeParameters( inputmat,label_train, vystup )
%% Funkce pro vypocet Spearman, MI, Mann-Whitney, ACC, SEN, SPE, TSS
%
% inputmat - natrenovana matice
% label_train - vektor 0 a 1 (0 - zdravy recnik, 1 - pacient s PN)
% vystup - cell vypocitanych parametru

%% Popisky
outputmat = cell(1151);
for i=1:length(vystup)
   outputmat(i,1) = vystup(i,1);     
end

outputmat(1,2) = cellstr('Sperman');
outputmat(1,3) = cellstr('MI');
outputmat(1,4) = cellstr('Mann-Whitney');
outputmat(1,5) = cellstr('ACC');
outputmat(1,6) = cellstr('SEN');
outputmat(1,7) = cellstr('SPE');
outputmat(1,8) = cellstr('TSS');


%% Vypocet
A = label_train;

for row=2:length(inputmat)

 B = cell2mat(inputmat(row,1:length(label_train)+1));
%Spearman
 [RHO,PVAL] = corr(A',B','Type','Spearman');

% Mann-Whitney U-test
 p = ranksum(A,B);

% mutual information
 M = mutual_information(A', B'); 

% ACC
 ACC = accuracy(A,B);
 
% SEN
 SEN = sensitivity(A,B);

% SPE
 SPE = specificity(A,B);

% TSS
 TSS = tss(SEN,SPE);
 
%% Ulozeni vysledku
 outputmat(row,2) = num2cell(RHO);
 outputmat(row,3) = num2cell(p);
 outputmat(row,4) = num2cell(M);
 outputmat(row,5) = num2cell(ACC);
 outputmat(row,6) = num2cell(SEN);
 outputmat(row,7) = num2cell(SPE);
 outputmat(row,8) = num2cell(TSS);
 
disp(['pocitam radek c. ' num2str(row)]);
end

end

