% : vim: set filetype=matlab :
function ROC=CERT_ROC( filename )

    % Load the CERT output
    CERT_Results=load( filename );
    % CERT_Results=dlmread( filename, '\t', 1, 0 ); % skip the first row
    numAUS = size(CERT_Results);
    numAUS = numAUS(2);
    AUS=CERT_Results(:,2:numAUS);
    numAUS = numAUS - 1;

    % load the labels and choose the right ones
    % load Subj16_AU1_all.mat;
    load labels_032.mat;

    if( numAUS == 8 )
        labels_x=LABELS(:,[1:4 6 7 8 11]); % we only need some of the labels
    elseif( numAUS == 10 )
        labels_x=LABELS(:,[1:4 6 7 8 11 12 13]); % we only need some of the labels, includes 1+2+4, 1-2
    elseif( numAUS == 13 )
        labels_x=LABELS;
    elseif( numAUS == 15 )
        % Eight base AUs, 5 emotion weights, 2 MLR weights
        labels_x=LABELS(:,[1:4 6 7 8 11 12 13 12, 13, 12, 12, 13]); % we only need some of the labels, includes 1+2+4, 1-2
    else
        fprintf('Unknown number of labels: %d\n', numAUS );
        return;
    end

    ROC=ROC_area( AUS, labels_x );

end
