@@ -173,7 +173,7 @@ public interface CostFunctionsSettings {
173
173
Option VISUALIZE_CLASSIFICATION_ACCURACY = new Option ("visualize the classification accuracy" , "VC" , 0 , "visualize the classification accuracy" );
174
174
Option VISUALIZE_WEIGHTED_ACCURACY = new Option ("visualize the weighted accuracy" , "VA" , 0 , "visualize the weighted accuracy" );
175
175
Option VISUALIZE_FMEASURE = new Option ("visualize the f-measure" , "VF" , 0 , "visualize the f measure" );
176
- Option VISUALIZE_PRECISION_RECALL = new Option ("visualize precision recall" , "VP" , 0 , "visualize precicion precall " );
176
+ Option VISUALIZE_PRECISION_RECALL = new Option ("visualize precision recall" , "VP" , 0 , "visualize precision recall " );
177
177
Option VISUALIZE_DEFAULT_COST = new Option ("visualize GMLVQ default cost function" , "VD" , 0 , "visualize the GMLVQ default cost function" );
178
178
}
179
179
@@ -272,10 +272,6 @@ public double get_2_dataPointRatioPerRound() {
272
272
return this .builder .getDataPointRatioPerRound ();
273
273
}
274
274
275
- // public double get_2_learnRateChange() {
276
- // return this.builder.getLearnRateChange();
277
- // }
278
-
279
275
public int getNumberOfClasses () {
280
276
return this .builder .getNumberOfClasses ();
281
277
}
@@ -306,11 +302,9 @@ public String[] getOptions() {
306
302
commandLine .add ("" + this .builder .getNumberOfEpochs ());
307
303
commandLine .add ("-" + AlgorithmSettings .NUMBER_OF_PROTOTYPES_OPTION .name ());
308
304
commandLine .add ("" + this .builder .getNumberOfPrototypesPerClass ());
309
- // commandLine.add("-" + AlgorithmSettings.STOP_CRITERION_OPTION.name());
310
- // commandLine.add("" + this.builder.getStopCriterion());
311
- // if (this.builder.isVisualization()) {
312
- // commandLine.add("-" + AlgorithmSettings.VISUALIZATION_OPTION.name());
313
- // }
305
+ if (this .builder .isVisualization ()) {
306
+ commandLine .add ("-" + AlgorithmSettings .VISUALIZATION_OPTION .name ());
307
+ }
314
308
commandLine .add ("-" + AlgorithmSettings .DATA_POINTS_PER_ROUND_OPTION .name ());
315
309
commandLine .add ("" + this .builder .getDataPointRatioPerRound ());
316
310
commandLine .add ("-" + AlgorithmSettings .SIGMOID_SIGMA_INTERVAL_OPTION .name ());
@@ -326,11 +320,6 @@ public String[] getOptions() {
326
320
if (this .builder .isMatrixLearning ()) {
327
321
commandLine .add ("-" + MethodSettings .MATRIX_LEARNING_OPTION .name ());
328
322
}
329
- // commandLine.add("-" + MethodSettings.LEARN_RATE_CHANGE_OPTION.name());
330
- // commandLine.add("" + this.builder.getLearnRateChange());
331
- // if (this.builder.isParallelExecution()) {
332
- // commandLine.add("-" + MethodSettings.PARALLEL_EXECUTION_OPTION.name());
333
- // }
334
323
335
324
// cost function settings
336
325
commandLine .add ("-" + CostFunctionsSettings .COST_FUNCTION_TO_OPTIMIZE_OPTION .name ());
@@ -377,10 +366,6 @@ public String get_2_costFunctionWeights() {
377
366
return this .builder .getCostFunctionWeights ();
378
367
}
379
368
380
- // public double get_2_stopCriterion() {
381
- // return this.builder.getStopCriterion();
382
- // }
383
-
384
369
@ Override
385
370
public TechnicalInformation getTechnicalInformation () {
386
371
// TODO add publication and stuff
@@ -433,10 +418,6 @@ public static boolean isRelevanceLearning(Matrix omegaMatrix) {
433
418
return omegaMatrix .getColumnDimension () != 1 && omegaMatrix .getRowDimension () != 1 ;
434
419
}
435
420
436
- // public String _2_learnRateChangeTipText() {
437
- // return "the change of the learning rate";
438
- // }
439
-
440
421
@ Override
441
422
public Enumeration <Option > listOptions () {
442
423
@@ -445,7 +426,6 @@ public Enumeration<Option> listOptions() {
445
426
// algorithm settings
446
427
options .addElement (AlgorithmSettings .NUMBER_OF_EPOCHS_OPTION );
447
428
options .addElement (AlgorithmSettings .NUMBER_OF_PROTOTYPES_OPTION );
448
- // options.addElement(AlgorithmSettings.STOP_CRITERION_OPTION);
449
429
options .addElement (AlgorithmSettings .VISUALIZATION_OPTION );
450
430
options .addElement (AlgorithmSettings .DATA_POINTS_PER_ROUND_OPTION );
451
431
options .addElement (AlgorithmSettings .SIGMOID_SIGMA_INTERVAL_OPTION );
@@ -523,10 +503,6 @@ public String _2_sigmoidSigmaIntervalTipText() {
523
503
return "interval of the parameter of the sigmoid/Fermit function which is part of the cost function" ;
524
504
}
525
505
526
- // public String _2_stopCriterionTipText() {
527
- // return "stop criterion: if learning ratio is smaller than this value, the learning is stopped";
528
- // }
529
-
530
506
public String _1_visualizationTipText () {
531
507
return "determines if the progress should be visualized" ;
532
508
}
@@ -559,10 +535,6 @@ public void set_2_dataPointRatioPerRound(double dataPointRatioPerRound) {
559
535
this .builder .dataPointRatioPerRound (dataPointRatioPerRound );
560
536
}
561
537
562
- // public void set_2_learnRateChange(double learnRateChange) {
563
- // this.builder.learnRateChange(learnRateChange);
564
- // }
565
-
566
538
public void set_2_matrixLearning (boolean matrixLearning ) {
567
539
this .builder .matrixLearning (matrixLearning );
568
540
@@ -649,13 +621,6 @@ public void setOptions(String[] options) throws Exception {
649
621
this .builder .numberOfPrototypesPerClass (AlgorithmSettings .DEFAULT_NUMBER_OF_PROTOTYPES_PER_CLASS );
650
622
}
651
623
652
- // String stopCriterionString = Utils.getOption(AlgorithmSettings.STOP_CRITERION_OPTION.name().charAt(0), options);
653
- // if (stopCriterionString.length() != 0) {
654
- // this.builder.stopCriterion(Double.parseDouble(stopCriterionString));
655
- // } else {
656
- // this.builder.stopCriterion(AlgorithmSettings.DEFAULT_STOP_CRITERION);
657
- // }
658
-
659
624
this .builder .visualization (Utils .getFlag (AlgorithmSettings .VISUALIZATION_OPTION .name ().charAt (0 ), options ));
660
625
661
626
String dataPointsPerRoundString = Utils
@@ -672,10 +637,6 @@ public void setOptions(String[] options) throws Exception {
672
637
this .builder .sigmoidSigmaInterval (sigmoidSigmaIntervalString );
673
638
} else {
674
639
this .builder .sigmoidSigmaInterval (AlgorithmSettings .DEFAULT_SIGMOID_SIGMA_INTERVAL );
675
- // initialize with sigmoid sigma default values - not needed anymore
676
- // - probably
677
- // this.embeddedSpaceCalculator.setSigmoidSigmaInterval(AlgorithmSettings.DEFAULT_SIGMOID_SIGMA_INTERVAL_START,
678
- // AlgorithmSettings.DEFAULT_SIGMOID_SIGMA_INTERVAL_END);
679
640
}
680
641
681
642
// method settings
@@ -704,14 +665,6 @@ public void setOptions(String[] options) throws Exception {
704
665
this .builder .omegaDimension (MethodSettings .DEFAULT_OMEGA_DIMENSION );
705
666
}
706
667
707
- // String learnRateChangeString = Utils.getOption(MethodSettings.LEARN_RATE_CHANGE_OPTION.name().charAt(0),
708
- // options);
709
- // if (omegaDimensionString.length() != 0) {
710
- // this.builder.learnRateChange(Double.parseDouble(learnRateChangeString));
711
- // } else {
712
- // this.builder.learnRateChange(MethodSettings.DEFAULT_OMEGA_DIMENSION);
713
- // }
714
-
715
668
this .builder
716
669
.parallelExecution (Utils .getFlag (MethodSettings .PARALLEL_EXECUTION_OPTION .name ().charAt (0 ), options ));
717
670
@@ -734,6 +687,25 @@ public void setOptions(String[] options) throws Exception {
734
687
this .builder .costFunctionBeta (CostFunctionCalculator .DEFAULT_BETA );
735
688
}
736
689
690
+ String costFunctionWeightString = Utils
691
+ .getOption (CostFunctionsSettings .COST_FUNCTION_WEIGHTS_OPTION .name ().charAt (0 ), options );
692
+ if (costFunctionWeightString .length () != 0 ) {
693
+ this .builder .costFunctionWeights (costFunctionWeightString );
694
+ } else {
695
+ this .builder .costFunctionWeights (CostFunctionCalculator .DEFAULT_WEIGHTS );
696
+ }
697
+
698
+ this .builder
699
+ .visualizeDefaultCost (Utils .getFlag (CostFunctionsSettings .VISUALIZE_DEFAULT_COST .name (), options ));
700
+ this .builder
701
+ .visualizeFMeasure (Utils .getFlag (CostFunctionsSettings .VISUALIZE_FMEASURE .name (), options ));
702
+ this .builder
703
+ .visualizePrecisionRecall (Utils .getFlag (CostFunctionsSettings .VISUALIZE_PRECISION_RECALL .name (), options ));
704
+ this .builder
705
+ .visualizeWeightedAccuracy (Utils .getFlag (CostFunctionsSettings .VISUALIZE_WEIGHTED_ACCURACY .name (), options ));
706
+ this .builder
707
+ .visualizeClassificationAccuracy (Utils .getFlag (CostFunctionsSettings .VISUALIZE_CLASSIFICATION_ACCURACY .name (), options ));
708
+
737
709
super .setOptions (options );
738
710
}
739
711
@@ -756,11 +728,6 @@ public void set_2_costFunctionWeights(String costFunctionWeightsString) {
756
728
this .builder .costFunctionWeights (costFunctionWeightsString );
757
729
}
758
730
759
- // public void set_2_stopCriterion(double stopCriterion) {
760
- // this.builder.stopCriterion(stopCriterion);
761
- //
762
- // }
763
-
764
731
public void set_1_visualization (boolean visualization ) {
765
732
this .builder .visualization (visualization );
766
733
0 commit comments