title: How to plot a DET curve from results provided by Weka?
body: <p>I am facing a problem of classification between 4 classes, I used for this classification Weka and I get a result in this form:</p>
  
  <pre><code>Correctly Classified Instances        3860               96.5    %
  Incorrectly Classified Instances       140                3.5    %
  Kappa statistic                          0.9533
  Mean absolute error                      0.0178
  Root mean squared error                  0.1235
  Relative absolute error                  4.7401 %
  Root relative squared error             28.5106 %
  Total Number of Instances             4000     
  
  === Detailed Accuracy By Class ===
  
                 TP Rate   FP Rate   Precision   Recall  F-Measure   ROC Area  Class
                   0.98      0.022      0.936     0.98      0.957      0.998    A
                   0.92      0.009      0.973     0.92      0.946      0.997    B
                   0.991     0.006      0.982     0.991     0.987      1        C
                   0.969     0.01       0.971     0.969     0.97       0.998    D
  Weighted Avg.    0.965     0.012      0.965     0.965     0.965      0.998
  
  === Confusion Matrix ===
  
     a   b   c   d   &lt;-- classified as
   980  17   1   2 |   a = A
    61 920   1  18 |   b = B
     0   0 991   9 |   c = C
     6   9  16 969 |   d = D
  </code></pre>
  
  <p>My goal now is to draw (The <a href="http://en.wikipedia.org/wiki/Detection_error_tradeoff" rel="nofollow">Detection Error Trade-off</a>) DET curve from results provided by Weka.</p>
  
  <p>I found a MATLAB code that allows me to draw the DET curve, here are some line of code in  this function:</p>
  
  <pre><code>Ntrials_True = 1000;
     True_scores = randn(Ntrials_True,1);
  
     Ntrials_False = 1000;
        mean_False = -3;
        stdv_False = 1.5;
     False_scores = stdv_False * randn(Ntrials_False,1) + mean_False;
  
     %-----------------------
     % Compute Pmiss and Pfa from experimental detection output scores
  
     [P_miss,P_fa] = Compute_DET(True_scores,False_scores);
  </code></pre>
  
  <p>the code of function <code>Compute_DET</code> is:</p>
  
  <pre><code>[Pmiss, Pfa] = Compute_DET(true_scores, false_scores)
  num_true = max(size(true_scores));
  num_false = max(size(false_scores));
  
  total=num_true+num_false;
  
  Pmiss = zeros(num_true+num_false+1, 1); %preallocate for speed
  Pfa   = zeros(num_true+num_false+1, 1); %preallocate for speed
  
  scores(1:num_false,1) = false_scores;
  scores(1:num_false,2) = 0;
  scores(num_false+1:total,1) = true_scores;
  scores(num_false+1:total,2) = 1;
  
  scores=DETsort(scores);
  
  sumtrue=cumsum(scores(:,2),1);
  sumfalse=num_false - ([1:total]'-sumtrue);
  
  Pmiss(1) = 0;
  Pfa(1) = 1.0;
  Pmiss(2:total+1) = sumtrue  ./ num_true;
  Pfa(2:total+1)   = sumfalse ./ num_false;
  
  return
  </code></pre>
  
  <p>but I have a problem with the translation of the meaning of different parameters. for example what is the significance of <code>mean_False</code> and <code>stdv_False</code> and what is the correspondence with the parameters of Weka?</p>