Changeset 63


Ignore:
Timestamp:
04/28/16 16:51:19 (9 years ago)
Author:
sherbold
Message:
  • added fpr and fnr as metrics; using MCC now directly from weka
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/eval/AbstractWekaEvaluation.java

    r44 r63  
    119119                output.append(",tpr_" + ((IWekaCompatibleTrainer) trainer).getName()); 
    120120                output.append(",tnr_" + ((IWekaCompatibleTrainer) trainer).getName()); 
     121                output.append(",fpr_" + ((IWekaCompatibleTrainer) trainer).getName()); 
     122                output.append(",fnr_" + ((IWekaCompatibleTrainer) trainer).getName()); 
    121123                output.append(",tp_" + ((IWekaCompatibleTrainer) trainer).getName()); 
    122124                output.append(",fn_" + ((IWekaCompatibleTrainer) trainer).getName()); 
    123125                output.append(",tn_" + ((IWekaCompatibleTrainer) trainer).getName()); 
    124126                output.append(",fp_" + ((IWekaCompatibleTrainer) trainer).getName()); 
    125                 //output.append(",trainerror_" + ((IWekaCompatibleTrainer) trainer).getName()); 
    126                 //output.append(",trainrecall_" + ((IWekaCompatibleTrainer) trainer).getName()); 
    127                 //output.append(",trainprecision_" + ((IWekaCompatibleTrainer) trainer).getName()); 
    128                 //output.append(",trainsuccHe_" + ((IWekaCompatibleTrainer) trainer).getName()); 
    129127            } 
    130128            output.append(StringTools.ENDLINE); 
     
    144142                eval.numFalsePositives(1) / (eval.numFalsePositives(1) + eval.numTrueNegatives(1)); 
    145143            double gmeasure = 2 * eval.recall(1) * (1.0 - pf) / (eval.recall(1) + (1.0 - pf)); 
    146             double mcc = 
    147                 (eval.numTruePositives(1) * eval.numTrueNegatives(1) - eval.numFalsePositives(1) * 
    148                     eval.numFalseNegatives(1)) / 
    149                     Math.sqrt((eval.numTruePositives(1) + eval.numFalsePositives(1)) * 
    150                         (eval.numTruePositives(1) + eval.numFalseNegatives(1)) * 
    151                         (eval.numTrueNegatives(1) + eval.numFalsePositives(1)) * 
    152                         (eval.numTrueNegatives(1) + eval.numFalseNegatives(1))); 
    153144            double aucec = calculateReviewEffort(testdata, classifier); 
    154145 
     
    186177            output.append("," + eval.fMeasure(1)); 
    187178            output.append("," + gmeasure); 
    188             output.append("," + mcc); 
     179            output.append("," + eval.matthewsCorrelationCoefficient(1)); 
    189180            output.append("," + eval.areaUnderROC(1)); 
    190181            output.append("," + aucec); 
    191182            output.append("," + eval.truePositiveRate(1)); 
    192183            output.append("," + eval.trueNegativeRate(1)); 
     184            output.append("," + eval.falsePositiveRate(1)); 
     185            output.append("," + eval.falseNegativeRate(1)); 
    193186            output.append("," + eval.numTruePositives(1)); 
    194187            output.append("," + eval.numFalseNegatives(1)); 
    195188            output.append("," + eval.numTrueNegatives(1)); 
    196189            output.append("," + eval.numFalsePositives(1)); 
    197             /*output.append("," + evalTrain.errorRate()); 
    198             output.append("," + evalTrain.recall(1)); 
    199             output.append("," + evalTrain.precision(1)); 
    200             if (evalTrain.recall(1) >= 0.7 && evalTrain.precision(1) >= 0.5) { 
    201                 output.append(",1"); 
    202             } 
    203             else { 
    204                 output.append(",0"); 
    205             }*/ 
    206190        } 
    207191 
Note: See TracChangeset for help on using the changeset viewer.