TEAP (Toolbox for Emotion Analysis using Physiological Signals) doc
regressionPrec.m
Go to the documentation of this file.
1 function [evals] = regressionPrec(labels, groundTruth)
2 %Mohammad Soleymani Imperial College London, 2013
3 %m.soleymani@imperial.ac.uk
4 %function [evals] =
5 %regressionPrec(labels, groundTruth)
6 %This function gives you pearson, Kendall tau ranking correlation, linear
7 %distances
8 %it is assumed that the labels (estimated and correct) are numeric
9 %inputs:
10 % labels: the esimated labels
11 % groundTruth: ground truth (correct labels)
12 %outputs:
13 %evals : the structure with all the outputs mentioned above
14 
15 labels = labels(:);
16 groundTruth = groundTruth(:);
17 [r p]= corr([groundTruth labels]);
18 evals.rho = r(2,1);
19 evals.p_pearson = p(2,1);
20 [r,p] = corr([groundTruth labels],'type','Spearman');
21 evals.r_sp = r(2,1);
22 evals.p_sp = p(2,1);
23 evals.MSE_avg = mean((groundTruth-labels).^2);
24 evals.RMSE = sqrt(mean((groundTruth-labels).^2));
25 evals.MSE_std = std((groundTruth-labels).^2);
26 evals.MAE = mean(abs(groundTruth-labels));
27 
regressionPrec
function regressionPrec(in labels, in groundTruth)