bbci / bbci_public

MATLAB toolbox for Brain-Computer Interfacing (BCI)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

proc_aucValues returns values larger than 1

svendaehne opened this issue · comments

The range of returned values should be between -1 and 1, at least according to the doc string.

Hi Sven!,

We ran into this problem today too, I think we have found the problem:

the ranksum function returns statistics (ranksum) for the first argument (class) (line 86), but currently the ranksum is later normalized (line 87) with respect to the smallest class. This means that whenever the second class has less samples, the proc_aucValue function is going to return incorrect results.

it is currently like this:
fv_aucval.x(ii) = (stats.ranksum-(min(sum(fv.y'))(min(sum(fv.y'))+1)/2))/prod(sum(fv.y'));
this should fix it:
fv_aucval.x(ii) = (stats.ranksum-(sum(fv.y(1,:))
(sum(fv.y(1,:))+1)/2))/prod(sum(fv.y'));

I forwarded the problem to Stefan Haufe, who wrote the function. My version of AUC is loss_rocArea.m, but Stefan's version is much better. When the bug is fixed.
Thanks for your suggestion, Sebastian! Let's see whether Stefan approves it.

Sure!, always happy to contribute.

jscastanoc was right, I fixed it as suggested.