Changeset 43 for trunk/CrossPare/src/de/ugoe/cs/cpdp/dataprocessing
- Timestamp:
- 11/13/15 22:48:28 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/dataprocessing/CLAMIProcessor.java
r42 r43 138 138 int violationCutoff = violationCountInterator.next(); 139 139 // 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 140 145 boolean[] cleanInstances = new boolean[data.numInstances()]; 141 146 int numCleanBuggyInstances = 0; … … 150 155 Instance currentInstance = data.get(i); 151 156 for (int j = 0; j < data.numAttributes(); j++) { 152 if (j != data.classIndex() && numMetricViolations[j] <= violationCutoff) {157 if (j != data.classIndex() && numMetricViolations[j] == violationCutoff) { 153 158 if (clusterNumber[i] > medianClusterNumber) { 154 159 // "buggy" … … 180 185 } 181 186 while (numCleanBuggyInstances == 0 || numCleanBugfreeInstances == 0); 182 187 183 188 // output some interesting information to provide insights into the CLAMI model 184 189 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) { 187 192 Console.traceln(Level.FINE, "\t" + data.attribute(j).name() + ": " + medians[j]); 188 193 } 189 194 } 190 195 191 196 // finally modify the instances 192 197 // drop the metrics (also from the testdata) 193 198 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) { 195 200 data.deleteAttributeAt(j); 196 201 testdata.deleteAttributeAt(j);
Note: See TracChangeset
for help on using the changeset viewer.