Changeset 44 for trunk/CrossPare/src/de/ugoe/cs
- Timestamp:
- 11/17/15 20:42:08 (9 years ago)
- Location:
- trunk/CrossPare/src/de/ugoe/cs/cpdp
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/ExperimentConfiguration.java
r41 r44 1 // Copyright 2015 Georg-August-Universit ät Göttingen, Germany1 // Copyright 2015 Georg-August-Universit�t G�ttingen, Germany 2 2 // 3 3 // Licensed under the Apache License, Version 2.0 (the "License"); … … 40 40 import de.ugoe.cs.cpdp.eval.IEvaluationStrategy; 41 41 import de.ugoe.cs.cpdp.loader.IVersionLoader; 42 import de.ugoe.cs.cpdp.training.ISetWiseTestdataAwareTrainingStrategy; 42 43 import de.ugoe.cs.cpdp.training.ISetWiseTrainingStrategy; 43 44 import de.ugoe.cs.cpdp.training.ITrainingStrategy; … … 114 115 115 116 /** 117 * setwise testdata aware trainers, i.e., trainers that require the selected training data to be separate from 118 * each other and the current testdata 119 */ 120 private List<ISetWiseTestdataAwareTrainingStrategy> setwiseTestdataAwareTrainers; 121 122 /** 116 123 * data processors that are applied before the pointwise data selection 117 124 */ … … 178 185 setwisepostprocessors = new LinkedList<>(); 179 186 setwiseTrainers = new LinkedList<>(); 187 setwiseTestdataAwareTrainers = new LinkedList<>(); 180 188 preprocessors = new LinkedList<>(); 181 189 pointwiseselectors = new LinkedList<>(); … … 324 332 } 325 333 334 /** 335 * returns the setwise training algorithms 336 * 337 * @return setwise training algorithms 338 */ 339 public List<ISetWiseTestdataAwareTrainingStrategy> getSetWiseTestdataAwareTrainers() { 340 return setwiseTestdataAwareTrainers; 341 } 342 326 343 /** 327 344 * returns the processors applied before the pointwise data selection … … 465 482 trainer.setParameter(attributes.getValue("param")); 466 483 setwiseTrainers.add(trainer); 484 } 485 else if (qName.equals("setwisetestdataawaretrainer")) { 486 final ISetWiseTestdataAwareTrainingStrategy trainer = 487 (ISetWiseTestdataAwareTrainingStrategy) Class.forName("de.ugoe.cs.cpdp.training." + 488 attributes.getValue("name")) 489 .newInstance(); 490 trainer.setParameter(attributes.getValue("param")); 491 setwiseTestdataAwareTrainers.add(trainer); 467 492 } 468 493 else if (qName.equals("preprocessor")) { … … 566 591 setwisepostprocessors.addAll(other.setwisepostprocessors); 567 592 setwiseTrainers.addAll(other.setwiseTrainers); 593 setwiseTestdataAwareTrainers.addAll(other.setwiseTestdataAwareTrainers); 568 594 preprocessors.addAll(other.preprocessors); 569 595 pointwiseselectors.addAll(other.pointwiseselectors); … … 609 635 StringTools.ENDLINE); 610 636 builder.append("Setwise trainers: " + setwiseTrainers.toString() + StringTools.ENDLINE); 637 builder.append("Setwise Testdata Aware trainers: " + setwiseTestdataAwareTrainers.toString() + StringTools.ENDLINE); 611 638 builder 612 639 .append("Pointwise preprocessors: " + preprocessors.toString() + StringTools.ENDLINE); -
trunk/CrossPare/src/de/ugoe/cs/cpdp/eval/AbstractWekaEvaluation.java
r41 r44 123 123 output.append(",tn_" + ((IWekaCompatibleTrainer) trainer).getName()); 124 124 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());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()); 129 129 } 130 130 output.append(StringTools.ENDLINE); … … 136 136 137 137 Evaluation eval = null; 138 Evaluation evalTrain = null;138 //Evaluation evalTrain = null; 139 139 for (Classifier classifier : classifiers) { 140 140 eval = createEvaluator(testdata, classifier); 141 evalTrain = createEvaluator(traindata, classifier);141 //evalTrain = createEvaluator(traindata, classifier); 142 142 143 143 double pf = … … 195 195 output.append("," + eval.numTrueNegatives(1)); 196 196 output.append("," + eval.numFalsePositives(1)); 197 output.append("," + evalTrain.errorRate());197 /*output.append("," + evalTrain.errorRate()); 198 198 output.append("," + evalTrain.recall(1)); 199 199 output.append("," + evalTrain.precision(1)); … … 203 203 else { 204 204 output.append(",0"); 205 } 205 }*/ 206 206 } 207 207 -
trunk/CrossPare/src/de/ugoe/cs/cpdp/execution/CrossProjectExperiment.java
r41 r44 31 31 import de.ugoe.cs.cpdp.eval.IEvaluationStrategy; 32 32 import de.ugoe.cs.cpdp.loader.IVersionLoader; 33 import de.ugoe.cs.cpdp.training.ISetWiseTestdataAwareTrainingStrategy; 33 34 import de.ugoe.cs.cpdp.training.ISetWiseTrainingStrategy; 34 35 import de.ugoe.cs.cpdp.training.ITrainer; … … 168 169 setwiseTrainer.apply(traindataSet); 169 170 } 171 for (ISetWiseTestdataAwareTrainingStrategy setwiseTestdataAwareTrainer : config.getSetWiseTestdataAwareTrainers()) { 172 Console.traceln(Level.FINE, String 173 .format("[%s] [%02d/%02d] %s: applying testdata aware setwise trainer %s", 174 config.getExperimentName(), versionCount, testVersionCount, 175 testVersion.getVersion(), setwiseTestdataAwareTrainer.getName())); 176 setwiseTestdataAwareTrainer.apply(traindataSet, testdata); 177 } 170 178 Instances traindata = makeSingleTrainingSet(traindataSet); 171 179 for (IProcessesingStrategy processor : config.getPreProcessors()) { … … 210 218 for (ISetWiseTrainingStrategy setwiseTrainer : config.getSetWiseTrainers()) { 211 219 allTrainers.add(setwiseTrainer); 220 } 221 for (ISetWiseTestdataAwareTrainingStrategy setwiseTestdataAwareTrainer : config.getSetWiseTestdataAwareTrainers()) { 222 allTrainers.add(setwiseTestdataAwareTrainer); 212 223 } 213 224 for (ITrainingStrategy trainer : config.getTrainers()) { -
trunk/CrossPare/src/de/ugoe/cs/cpdp/execution/RelaxedCrossProjectExperiment.java
r41 r44 31 31 import de.ugoe.cs.cpdp.eval.IEvaluationStrategy; 32 32 import de.ugoe.cs.cpdp.loader.IVersionLoader; 33 import de.ugoe.cs.cpdp.training.ISetWiseTestdataAwareTrainingStrategy; 33 34 import de.ugoe.cs.cpdp.training.ISetWiseTrainingStrategy; 34 35 import de.ugoe.cs.cpdp.training.ITrainer; … … 173 174 setwiseTrainer.apply(traindataSet); 174 175 } 176 for (ISetWiseTestdataAwareTrainingStrategy setwiseTestdataAwareTrainer : config.getSetWiseTestdataAwareTrainers()) { 177 Console.traceln(Level.FINE, String 178 .format("[%s] [%02d/%02d] %s: applying testdata aware setwise trainer %s", 179 config.getExperimentName(), versionCount, testVersionCount, 180 testVersion.getVersion(), setwiseTestdataAwareTrainer.getName())); 181 setwiseTestdataAwareTrainer.apply(traindataSet, testdata); 182 } 175 183 Instances traindata = makeSingleTrainingSet(traindataSet); 176 184 for (IProcessesingStrategy processor : config.getPreProcessors()) {
Note: See TracChangeset
for help on using the changeset viewer.