- Timestamp:
- 05/03/16 10:30:09 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/ExperimentConfiguration.java
r66 r68 39 39 import de.ugoe.cs.cpdp.dataselection.ISetWiseDataselectionStrategy; 40 40 import de.ugoe.cs.cpdp.eval.IEvaluationStrategy; 41 import de.ugoe.cs.cpdp.eval.IResultStorage; 41 42 import de.ugoe.cs.cpdp.loader.IVersionLoader; 42 43 import de.ugoe.cs.cpdp.training.ISetWiseTestdataAwareTrainingStrategy; … … 116 117 117 118 /** 118 * setwise testdata aware trainers, i.e., trainers that require the selected training data to be separate from119 * each other and the current testdata119 * setwise testdata aware trainers, i.e., trainers that require the selected training data to be 120 * separate from each other and the current testdata 120 121 */ 121 122 private List<ISetWiseTestdataAwareTrainingStrategy> setwiseTestdataAwareTrainers; 122 123 123 124 /** 124 125 * data processors that are applied before the pointwise data selection … … 140 141 */ 141 142 private List<ITrainingStrategy> trainers; 142 143 143 144 /** 144 145 * normal trainers, i.e., trainers that require the selected training data in a single data set … … 150 151 */ 151 152 private List<IEvaluationStrategy> evaluators; 153 154 /** 155 * result storages used for experiments 156 */ 157 private List<IResultStorage> resultStorages; 152 158 153 159 /** … … 198 204 testAwareTrainers = new LinkedList<>(); 199 205 evaluators = new LinkedList<>(); 206 resultStorages = new LinkedList<>(); 200 207 201 208 if (file == null) { … … 347 354 return setwiseTestdataAwareTrainers; 348 355 } 349 356 350 357 /** 351 358 * returns the processors applied before the pointwise data selection … … 383 390 return trainers; 384 391 } 385 392 386 393 /** 387 394 * returns the test aware training algorithms … … 400 407 public List<IEvaluationStrategy> getEvaluators() { 401 408 return evaluators; 409 } 410 411 public List<IResultStorage> getResultStorages() { 412 return resultStorages; 402 413 } 403 414 … … 435 446 } 436 447 else if (qName.equals("loader")) { 437 final IVersionLoader loader = 438 (IVersionLoader) Class.forName("de.ugoe.cs.cpdp.loader." + 439 attributes.getValue("name")).newInstance(); 448 final IVersionLoader loader = (IVersionLoader) Class 449 .forName("de.ugoe.cs.cpdp.loader." + attributes.getValue("name")).newInstance(); 440 450 loader.setLocation(attributes.getValue("datalocation")); 441 451 loaders.add(loader); … … 447 457 } 448 458 else if (qName.equals("versionfilter")) { 449 final IVersionFilter filter = 450 (IVersionFilter) Class.forName("de.ugoe.cs.cpdp.versions." +451 attributes.getValue("name")).newInstance();459 final IVersionFilter filter = (IVersionFilter) Class 460 .forName("de.ugoe.cs.cpdp.versions." + attributes.getValue("name")) 461 .newInstance(); 452 462 filter.setParameter(attributes.getValue("param")); 453 463 versionFilters.add(filter); 454 464 } 455 465 else if (qName.equals("testVersionfilter")) { 456 final IVersionFilter filter = 457 (IVersionFilter) Class.forName("de.ugoe.cs.cpdp.versions." +458 attributes.getValue("name")).newInstance();466 final IVersionFilter filter = (IVersionFilter) Class 467 .forName("de.ugoe.cs.cpdp.versions." + attributes.getValue("name")) 468 .newInstance(); 459 469 filter.setParameter(attributes.getValue("param")); 460 470 testVersionFilters.add(filter); 461 471 } 462 472 else if (qName.equals("trainVersionfilter")) { 463 final IVersionFilter filter = 464 (IVersionFilter) Class.forName("de.ugoe.cs.cpdp.versions." +465 attributes.getValue("name")).newInstance();473 final IVersionFilter filter = (IVersionFilter) Class 474 .forName("de.ugoe.cs.cpdp.versions." + attributes.getValue("name")) 475 .newInstance(); 466 476 filter.setParameter(attributes.getValue("param")); 467 477 trainingVersionFilters.add(filter); 468 478 } 469 479 else if (qName.equals("setwisepreprocessor")) { 470 final ISetWiseProcessingStrategy processor = 471 (ISetWiseProcessingStrategy) Class.forName("de.ugoe.cs.cpdp.dataprocessing." + 472 attributes.getValue("name")) 473 .newInstance(); 480 final ISetWiseProcessingStrategy processor = (ISetWiseProcessingStrategy) Class 481 .forName("de.ugoe.cs.cpdp.dataprocessing." + attributes.getValue("name")) 482 .newInstance(); 474 483 processor.setParameter(attributes.getValue("param")); 475 484 setwisepreprocessors.add(processor); … … 477 486 else if (qName.equals("setwiseselector")) { 478 487 final ISetWiseDataselectionStrategy selection = 479 (ISetWiseDataselectionStrategy) Class .forName("de.ugoe.cs.cpdp.dataselection." +480 488 (ISetWiseDataselectionStrategy) Class 489 .forName("de.ugoe.cs.cpdp.dataselection." + attributes.getValue("name")) 481 490 .newInstance(); 482 491 selection.setParameter(attributes.getValue("param")); … … 484 493 } 485 494 else if (qName.equals("setwisepostprocessor")) { 486 final ISetWiseProcessingStrategy processor = 487 (ISetWiseProcessingStrategy) Class.forName("de.ugoe.cs.cpdp.dataprocessing." + 488 attributes.getValue("name")) 489 .newInstance(); 495 final ISetWiseProcessingStrategy processor = (ISetWiseProcessingStrategy) Class 496 .forName("de.ugoe.cs.cpdp.dataprocessing." + attributes.getValue("name")) 497 .newInstance(); 490 498 processor.setParameter(attributes.getValue("param")); 491 499 setwisepostprocessors.add(processor); 492 500 } 493 501 else if (qName.equals("setwisetrainer")) { 494 final ISetWiseTrainingStrategy trainer = 495 (ISetWiseTrainingStrategy) Class.forName("de.ugoe.cs.cpdp.training." + 496 attributes.getValue("name")) 497 .newInstance(); 502 final ISetWiseTrainingStrategy trainer = (ISetWiseTrainingStrategy) Class 503 .forName("de.ugoe.cs.cpdp.training." + attributes.getValue("name")) 504 .newInstance(); 498 505 trainer.setParameter(attributes.getValue("param")); 499 506 setwiseTrainers.add(trainer); … … 501 508 else if (qName.equals("setwisetestdataawaretrainer")) { 502 509 final ISetWiseTestdataAwareTrainingStrategy trainer = 503 (ISetWiseTestdataAwareTrainingStrategy) Class .forName("de.ugoe.cs.cpdp.training." +504 510 (ISetWiseTestdataAwareTrainingStrategy) Class 511 .forName("de.ugoe.cs.cpdp.training." + attributes.getValue("name")) 505 512 .newInstance(); 506 513 trainer.setParameter(attributes.getValue("param")); … … 510 517 } 511 518 else if (qName.equals("preprocessor")) { 512 final IProcessesingStrategy processor = 513 (IProcessesingStrategy) Class.forName("de.ugoe.cs.cpdp.dataprocessing." + 514 attributes.getValue("name")) 515 .newInstance(); 519 final IProcessesingStrategy processor = (IProcessesingStrategy) Class 520 .forName("de.ugoe.cs.cpdp.dataprocessing." + attributes.getValue("name")) 521 .newInstance(); 516 522 processor.setParameter(attributes.getValue("param")); 517 523 preprocessors.add(processor); … … 526 532 } 527 533 else if (qName.equals("postprocessor")) { 528 final IProcessesingStrategy processor = 529 (IProcessesingStrategy) Class.forName("de.ugoe.cs.cpdp.dataprocessing." + 530 attributes.getValue("name")) 531 .newInstance(); 534 final IProcessesingStrategy processor = (IProcessesingStrategy) Class 535 .forName("de.ugoe.cs.cpdp.dataprocessing." + attributes.getValue("name")) 536 .newInstance(); 532 537 processor.setParameter(attributes.getValue("param")); 533 538 postprocessors.add(processor); 534 539 } 535 540 else if (qName.equals("trainer")) { 536 final ITrainingStrategy trainer = 537 (ITrainingStrategy) Class.forName("de.ugoe.cs.cpdp.training." + 538 attributes.getValue("name")) 539 .newInstance(); 541 final ITrainingStrategy trainer = (ITrainingStrategy) Class 542 .forName("de.ugoe.cs.cpdp.training." + attributes.getValue("name")) 543 .newInstance(); 540 544 trainer.setParameter(attributes.getValue("param")); 541 545 trainers.add(trainer); 542 546 } 543 547 else if (qName.equals("testawaretrainer")) { 544 final ITestAwareTrainingStrategy trainer = 545 (ITestAwareTrainingStrategy) Class.forName("de.ugoe.cs.cpdp.training." + 546 attributes.getValue("name")) 547 .newInstance(); 548 final ITestAwareTrainingStrategy trainer = (ITestAwareTrainingStrategy) Class 549 .forName("de.ugoe.cs.cpdp.training." + attributes.getValue("name")) 550 .newInstance(); 548 551 trainer.setParameter(attributes.getValue("param")); 549 552 testAwareTrainers.add(trainer); 550 553 } 551 554 else if (qName.equals("eval")) { 552 final IEvaluationStrategy evaluator = 553 (IEvaluationStrategy) Class.forName("de.ugoe.cs.cpdp.eval." + 554 attributes.getValue("name")) 555 .newInstance(); 555 final IEvaluationStrategy evaluator = (IEvaluationStrategy) Class 556 .forName("de.ugoe.cs.cpdp.eval." + attributes.getValue("name")).newInstance(); 556 557 evaluators.add(evaluator); 558 } 559 else if (qName.equals("storage")) { 560 final IResultStorage resultStorage = (IResultStorage) Class 561 .forName("de.ugoe.cs.cpdp.eval." + attributes.getValue("name")).newInstance(); 562 resultStorages.add(resultStorage); 557 563 } 558 564 else if (qName.equals("saveClassifier")) { … … 625 631 626 632 if (!executionStrategy.equals(other.executionStrategy)) { 627 throw new ExperimentConfigurationException( 628 "Executionstrategies must be the same, if config files should be added."); 633 throw new ExperimentConfigurationException("Executionstrategies must be the same, if config files should be added."); 629 634 } 630 635 … … 651 656 builder.append("Results path: " + resultsPath + StringTools.ENDLINE); 652 657 builder.append("Version filters: " + versionFilters.toString() + StringTools.ENDLINE); 653 builder .append("Test version filters: " + testVersionFilters.toString() +654 StringTools.ENDLINE);658 builder 659 .append("Test version filters: " + testVersionFilters.toString() + StringTools.ENDLINE); 655 660 builder.append("Training version filters: " + trainingVersionFilters.toString() + 656 661 StringTools.ENDLINE); … … 661 666 StringTools.ENDLINE); 662 667 builder.append("Setwise trainers: " + setwiseTrainers.toString() + StringTools.ENDLINE); 663 builder.append("Setwise Testdata Aware trainers: " + setwiseTestdataAwareTrainers.toString() + StringTools.ENDLINE); 668 builder.append("Setwise Testdata Aware trainers: " + 669 setwiseTestdataAwareTrainers.toString() + StringTools.ENDLINE); 664 670 builder 665 671 .append("Pointwise preprocessors: " + preprocessors.toString() + StringTools.ENDLINE); 666 builder .append("Pointwise selectors: " + pointwiseselectors.toString() +667 StringTools.ENDLINE);668 builder .append("Pointwise postprocessors: " + postprocessors.toString() +669 StringTools.ENDLINE);672 builder 673 .append("Pointwise selectors: " + pointwiseselectors.toString() + StringTools.ENDLINE); 674 builder 675 .append("Pointwise postprocessors: " + postprocessors.toString() + StringTools.ENDLINE); 670 676 builder.append("Pointwise trainers: " + trainers.toString() + StringTools.ENDLINE); 671 677 builder.append("Evaluators: " + evaluators.toString() + StringTools.ENDLINE);
Note: See TracChangeset
for help on using the changeset viewer.