1

I'm trying calculate the ROC curve of a cross-validation. In particular, the parameter AUC (Area under the curve) and OPTROCPT (Optimal ROC Point). I thing I can calculate them by averaging the AUC and th OptROCPt of each iteration, but I didn't get correct results. What am I doing wrong?

My code is:

 cv = cvpartition(size(Y,1),'kfold',10);
 AUCvector=zeros(10,1);
 OptPtovector=zeros(10,2);

 for k=1:10
     istrain = training(cv,k);
     istest = test(cv,k);
     [b,dev,stats] = glmfit(X(istrain),y(istrain),'binomial','logit'); 
     p=glmval(b,X(istest),'logit'); $ Are p the scores for perfcurve?
     clear AUC OptPto
     [Temp1,Temp2,Temp3,AUC,OptPto]=perfcurve(y(istest),p,1);
     AUCvector(k,1)=AUC;
     OptPtovector(k,:)=OptPto;
  end
  mAUC=mean(AUCvector)
  mOptPto=mean(OptPtovector,2)

Best regards, Frank

m.s.
  • 16,063
  • 7
  • 53
  • 88
Frank
  • 11
  • 2
  • 1
    Please provide the formula that can be used to debug your code, so that someone will be able to answer the question. Also provide the incorrect results that you have encountered. – Ajoy Jul 18 '15 at 13:10

0 Answers0