Ignore:
Timestamp:
11/13/15 22:48:28 (9 years ago)
Author:
sherbold
Message:
  • fix of the CLAMI processor after clarification with the author
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/dataprocessing/CLAMIProcessor.java

    r42 r43  
    138138        int violationCutoff = violationCountInterator.next(); 
    139139        // now we filter the data; 
     140        // this is first tried with the metrics with fewest violations. if no buggy/bugfree 
     141        // instances remain, this is repeated with the next metrics with second fewest violations, 
     142        // and so on. 
     143        // this part is a bit unclear from the description in the paper, but I confirmed with the 
     144        // author that this is how they implemented it 
    140145        boolean[] cleanInstances = new boolean[data.numInstances()]; 
    141146        int numCleanBuggyInstances = 0; 
     
    150155                Instance currentInstance = data.get(i); 
    151156                for (int j = 0; j < data.numAttributes(); j++) { 
    152                     if (j != data.classIndex() && numMetricViolations[j] <= violationCutoff) { 
     157                    if (j != data.classIndex() && numMetricViolations[j] == violationCutoff) { 
    153158                        if (clusterNumber[i] > medianClusterNumber) { 
    154159                            // "buggy" 
     
    180185        } 
    181186        while (numCleanBuggyInstances == 0 || numCleanBugfreeInstances == 0); 
    182          
     187 
    183188        // output some interesting information to provide insights into the CLAMI model 
    184189        Console.traceln(Level.FINE, "Selected Metrics and Median-threshold: "); 
    185         for( int j=0 ; j<data.numAttributes(); j++) { 
    186             if( j!=data.classIndex() && numMetricViolations[j]<=violationCutoff ) { 
     190        for (int j = 0; j < data.numAttributes(); j++) { 
     191            if (j != data.classIndex() && numMetricViolations[j] == violationCutoff) { 
    187192                Console.traceln(Level.FINE, "\t" + data.attribute(j).name() + ": " + medians[j]); 
    188193            } 
    189194        } 
    190          
     195 
    191196        // finally modify the instances 
    192197        // drop the metrics (also from the testdata) 
    193198        for (int j = data.numAttributes() - 1; j >= 0; j--) { 
    194             if (j != data.classIndex() && numMetricViolations[j] > violationCutoff) { 
     199            if (j != data.classIndex() && numMetricViolations[j] != violationCutoff) { 
    195200                data.deleteAttributeAt(j); 
    196201                testdata.deleteAttributeAt(j); 
Note: See TracChangeset for help on using the changeset viewer.