Changeset 135 for trunk/CrossPare/src/de/ugoe/cs/cpdp/execution
- Timestamp:
- 07/18/16 12:26:03 (8 years ago)
- Location:
- trunk/CrossPare/src/de/ugoe/cs/cpdp/execution
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/execution/AbstractCrossProjectExperiment.java
r132 r135 155 155 } 156 156 } 157 157 158 158 // sort versions 159 159 Collections.sort(versions); … … 342 342 } 343 343 344 /** 345 * <p> 346 * helper function that checks if the results are already in the data store 347 * </p> 348 * 349 * @param version 350 * version for which the results are checked 351 * @return 352 */ 344 353 private int resultsAvailable(SoftwareVersion version) { 345 354 if (config.getResultStorages().isEmpty()) { 346 355 return 0; 347 356 } 348 357 349 358 List<ITrainer> allTrainers = new LinkedList<>(); 350 359 for (ISetWiseTrainingStrategy setwiseTrainer : config.getSetWiseTrainers()) { … … 362 371 allTrainers.add(trainer); 363 372 } 364 373 365 374 int available = Integer.MAX_VALUE; 366 375 for (IResultStorage storage : config.getResultStorages()) { 367 376 String classifierName = ((IWekaCompatibleTrainer) allTrainers.get(0)).getName(); 368 int curAvailable = storage.containsResult(config.getExperimentName(), version.getVersion(), classifierName); 369 if( curAvailable<available ) { 377 int curAvailable = storage.containsResult(config.getExperimentName(), 378 version.getVersion(), classifierName); 379 if (curAvailable < available) { 370 380 available = curAvailable; 371 381 } -
trunk/CrossPare/src/de/ugoe/cs/cpdp/execution/ClassifierCreationExperiment.java
r132 r135 107 107 108 108 for (IProcessesingStrategy processor : config.getPreProcessors()) { 109 Console.traceln(Level.FINE, String 110 .format("[%s] [%02d/%02d] %s: applying preprocessor %s", 111 config.getExperimentName(), versionCount, versions.size(), 112 testVersion.getProject(), processor.getClass().getName())); 109 Console.traceln(Level.FINE, 110 String.format("[%s] [%02d/%02d] %s: applying preprocessor %s", 111 config.getExperimentName(), versionCount, 112 versions.size(), testVersion.getProject(), 113 processor.getClass().getName())); 113 114 processor.apply(testdata, traindata); 114 115 } 115 116 116 117 for (IPointWiseDataselectionStrategy dataselector : config.getPointWiseSelectors()) { 117 Console.traceln(Level.FINE, String 118 .format("[%s] [%02d/%02d] %s: applying pointwise selection %s", 119 config.getExperimentName(), versionCount, versions.size(), 120 testVersion.getProject(), dataselector.getClass().getName())); 118 Console 119 .traceln(Level.FINE, 120 String.format("[%s] [%02d/%02d] %s: applying pointwise selection %s", 121 config.getExperimentName(), versionCount, 122 versions.size(), testVersion.getProject(), 123 dataselector.getClass().getName())); 121 124 traindata = dataselector.apply(testdata, traindata); 122 125 } 123 126 124 127 for (IProcessesingStrategy processor : config.getPostProcessors()) { 125 Console.traceln(Level.FINE, String 126 .format("[%s] [%02d/%02d] %s: applying setwise postprocessor %s", 127 config.getExperimentName(), versionCount, versions.size(), 128 testVersion.getProject(), processor.getClass().getName())); 128 Console 129 .traceln(Level.FINE, 130 String.format("[%s] [%02d/%02d] %s: applying setwise postprocessor %s", 131 config.getExperimentName(), versionCount, 132 versions.size(), testVersion.getProject(), 133 processor.getClass().getName())); 129 134 processor.apply(testdata, traindata); 130 135 } … … 148 153 try { 149 154 weka.core.SerializationHelper.write(resultsDir.getAbsolutePath() + "/" + 150 trainer.getName() + "-" + 151 testVersion.getProject(), 155 trainer.getName() + "-" + testVersion.getProject(), 152 156 trainerToSave.getClassifier()); 153 157 } … … 160 164 161 165 for (IEvaluationStrategy evaluator : config.getEvaluators()) { 162 Console.traceln(Level.FINE, String 163 .format("[%s] [%02d/%02d] %s: applying evaluator %s", 164 config.getExperimentName(), versionCount, versions.size(), 165 testVersion.getProject(), evaluator.getClass().getName())); 166 Console.traceln(Level.FINE, 167 String.format("[%s] [%02d/%02d] %s: applying evaluator %s", 168 config.getExperimentName(), versionCount, 169 versions.size(), testVersion.getProject(), 170 evaluator.getClass().getName())); 166 171 167 172 if (writeHeader) { … … 169 174 config.getExperimentName() + ".csv"); 170 175 } 171 evaluator.apply(testdata, traindata, allTrainers, efforts, writeHeader, config.getResultStorages()); 176 evaluator.apply(testdata, traindata, allTrainers, efforts, writeHeader, 177 config.getResultStorages()); 172 178 writeHeader = false; 173 179 } … … 175 181 versionCount++; 176 182 177 Console.traceln(Level.INFO, String.format("[%s] [%02d/%02d] %s: finished", 178 config.getExperimentName(), versionCount, 179 versions.size(), testVersion.getProject())); 183 Console.traceln(Level.INFO, 184 String.format("[%s] [%02d/%02d] %s: finished", 185 config.getExperimentName(), versionCount, versions.size(), 186 testVersion.getProject())); 180 187 181 188 } -
trunk/CrossPare/src/de/ugoe/cs/cpdp/execution/CrossValidationExperiment.java
r132 r135 138 138 } 139 139 } 140 140 141 141 numTrainers += config.getSetWiseTrainers().size(); 142 142 numTrainers += config.getSetWiseTestdataAwareTrainers().size(); … … 154 154 testVersionCount, testVersion.getVersion())); 155 155 int numResultsAvailable = resultsAvailable(testVersion); 156 if (numResultsAvailable >= numTrainers *config.getRepetitions()) {156 if (numResultsAvailable >= numTrainers * config.getRepetitions()) { 157 157 Console.traceln(Level.INFO, 158 158 String.format( … … 167 167 Instances testdata = testVersion.getInstances(); 168 168 List<Double> efforts = testVersion.getEfforts(); 169 169 170 170 for (ITrainingStrategy trainer : config.getTrainers()) { 171 171 Console.traceln(Level.FINE, … … 176 176 trainer.apply(testdata); 177 177 } 178 178 179 179 File resultsDir = new File(config.getResultsPath()); 180 180 if (!resultsDir.exists()) { … … 236 236 } 237 237 238 /** 239 * <p> 240 * helper function that checks if the results are already in the data store 241 * </p> 242 * 243 * @param version 244 * version for which the results are checked 245 * @return 246 */ 238 247 private int resultsAvailable(SoftwareVersion version) { 239 248 if (config.getResultStorages().isEmpty()) { 240 249 return 0; 241 250 } 242 251 243 252 List<ITrainer> allTrainers = new LinkedList<>(); 244 253 for (ISetWiseTrainingStrategy setwiseTrainer : config.getSetWiseTrainers()) { … … 256 265 allTrainers.add(trainer); 257 266 } 258 267 259 268 int available = Integer.MAX_VALUE; 260 269 for (IResultStorage storage : config.getResultStorages()) { 261 270 String classifierName = ((IWekaCompatibleTrainer) allTrainers.get(0)).getName(); 262 int curAvailable = storage.containsResult(config.getExperimentName(), version.getVersion(), classifierName); 263 if( curAvailable<available ) { 271 int curAvailable = storage.containsResult(config.getExperimentName(), 272 version.getVersion(), classifierName); 273 if (curAvailable < available) { 264 274 available = curAvailable; 265 275 }
Note: See TracChangeset
for help on using the changeset viewer.