Index: /branches/SensitivityEvaluator/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveWeightedPerformanceMeasuresEvaluator.cs
===================================================================
--- /branches/SensitivityEvaluator/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveWeightedPerformanceMeasuresEvaluator.cs	(revision 12210)
+++ /branches/SensitivityEvaluator/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveWeightedPerformanceMeasuresEvaluator.cs	(revision 12211)
@@ -1,7 +1,25 @@
-﻿using System;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
 using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -12,10 +30,10 @@
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.SingleObjective {
-  [Item("Weighted Performance Measures Evaluator", "Description")]
+  [Item("Weighted Performance Measures Evaluator", "Calculates the quality a symbolic classification solution based on three weighted measures(normalized mean squared error, false negative rate and false positve rate).")]
   [StorableClass]
   public class SymbolicClassificationSingleObjectiveWeightedPerformanceMeasuresEvaluator : SymbolicClassificationSingleObjectiveEvaluator {
     private const string NormalizedMeanSquaredErrorWeightingFactorParameterName = "NormalizedMeanSquaredErrorWeightingFactor";
-    private const string BetaParameterName = "Beta";
-    private const string GammaParameterName = "Gamma";
+    private const string FalseNegativeRateWeightingFactorParameterName = "FalseNegativeRateWeightingFactor";
+    private const string FalsePositiveRateWeightingFactorParameterName = "FalsePositiveRateWeightingFactor";
     private const string ModelCreatorParameterName = "ModelCreator";
 
@@ -26,9 +44,9 @@
       get { return (IFixedValueParameter<DoubleValue>)Parameters[NormalizedMeanSquaredErrorWeightingFactorParameterName]; }
     }
-    public IFixedValueParameter<DoubleValue> BetaParameter {
-      get { return (IFixedValueParameter<DoubleValue>)Parameters[BetaParameterName]; }
+    public IFixedValueParameter<DoubleValue> FalseNegativeRateWeightingFactorParameter {
+      get { return (IFixedValueParameter<DoubleValue>)Parameters[FalseNegativeRateWeightingFactorParameterName]; }
     }
-    public IFixedValueParameter<DoubleValue> GammaParameter {
-      get { return (IFixedValueParameter<DoubleValue>)Parameters[GammaParameterName]; }
+    public IFixedValueParameter<DoubleValue> FalsePositiveRateWeightingFactorParameter {
+      get { return (IFixedValueParameter<DoubleValue>)Parameters[FalsePositiveRateWeightingFactorParameterName]; }
     }
     public ILookupParameter<ISymbolicClassificationModelCreator> ModelCreatorParameter {
@@ -36,4 +54,20 @@
     }
     #endregion
+
+    public double NormalizedMeanSquaredErrorWeightingFactor {
+      get {
+        return NormalizedMeanSquaredErrorWeightingFactorParameter.Value.Value;
+      }
+    }
+    public double FalseNegativeRateWeightingFactor {
+      get {
+        return FalseNegativeRateWeightingFactorParameter.Value.Value;
+      }
+    }
+    public double FalsePositiveRateWeightingFactor {
+      get {
+        return FalsePositiveRateWeightingFactorParameter.Value.Value;
+      }
+    }
 
     [StorableConstructor]
@@ -49,6 +83,6 @@
       : base() {
       Parameters.Add(new FixedValueParameter<DoubleValue>(NormalizedMeanSquaredErrorWeightingFactorParameterName, "The weighting factor of the normalized mean squared error.", new DoubleValue(1)));
-      Parameters.Add(new FixedValueParameter<DoubleValue>(BetaParameterName, "Beta1", new DoubleValue(1)));
-      Parameters.Add(new FixedValueParameter<DoubleValue>(GammaParameterName, "Gamma1", new DoubleValue(1)));
+      Parameters.Add(new FixedValueParameter<DoubleValue>(FalseNegativeRateWeightingFactorParameterName, "The weighting factor of the false negative rate (1-sensitivity).", new DoubleValue(1)));
+      Parameters.Add(new FixedValueParameter<DoubleValue>(FalsePositiveRateWeightingFactorParameterName, "The weighting factor of the false positive rate (1-specificity).", new DoubleValue(1)));
       Parameters.Add(new LookupParameter<ISymbolicClassificationModelCreator>(ModelCreatorParameterName, "ModelCreator"));
     }
@@ -58,9 +92,6 @@
       var solution = SymbolicExpressionTreeParameter.ActualValue;
       var creator = ModelCreatorParameter.ActualValue;
-      double normalizedMeanSquaredErrorWeightingFactor = NormalizedMeanSquaredErrorWeightingFactorParameter.Value.Value;
-      double beta = BetaParameter.Value.Value;
-      double gamma = GammaParameter.Value.Value;
       double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper,
-              ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value, creator, normalizedMeanSquaredErrorWeightingFactor, beta, gamma);
+              ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value, creator, NormalizedMeanSquaredErrorWeightingFactor, FalseNegativeRateWeightingFactor, FalsePositiveRateWeightingFactor);
       QualityParameter.ActualValue = new DoubleValue(quality);
       return base.InstrumentedApply();
@@ -68,20 +99,21 @@
 
     public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData problemData,
-                IEnumerable<int> rows, bool applyLinearScaling, ISymbolicClassificationModelCreator modelCreator, double normalizedMeanSquaredErrorWeightingFactor, double betaParameter, double gammaParameter) {
+                IEnumerable<int> rows, bool applyLinearScaling, ISymbolicClassificationModelCreator modelCreator, double normalizedMeanSquaredErrorWeightingFactor, double falseNegativeRateWeightingFactor, double falsePositiveRateWeightingFactor) {
       IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
       IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
       OnlineCalculatorError errorState;
       double nmse;
-      
-      //calculate quality measures
+
+      //calculate performance measures
       var model = modelCreator.CreateSymbolicClassificationModel(solution, interpreter, lowerEstimationLimit, upperEstimationLimit);
       string positiveClassName = problemData.PositiveClass;
       model.RecalculateModelParameters(problemData, rows);
       var performanceCalculator = new ClassificationPerformanceMeasuresCalculator(positiveClassName, problemData.GetClassValue(positiveClassName));
-      var estimated = model.GetEstimatedClassValues(problemData.Dataset, rows);
-      performanceCalculator.Calculate(estimated, targetValues);
-      if (performanceCalculator.ErrorState != OnlineCalculatorError.None) return Double.NaN;
+      var estimatedClassValues = model.GetEstimatedClassValues(problemData.Dataset, rows);
+      performanceCalculator.Calculate(estimatedClassValues, targetValues);
+      if (performanceCalculator.ErrorState != OnlineCalculatorError.None) 
+        return Double.NaN;
+      double falseNegativeRate = 1 - performanceCalculator.TruePositiveRate;
       double falsePositiveRate = performanceCalculator.FalsePositiveRate;
-      double falseNegativeRate = 1 - performanceCalculator.TruePositiveRate;
 
       if (applyLinearScaling) {
@@ -95,5 +127,6 @@
       }
       if (errorState != OnlineCalculatorError.None) return Double.NaN;
-      return normalizedMeanSquaredErrorWeightingFactor * nmse + betaParameter * falsePositiveRate + gammaParameter * falseNegativeRate;
+
+      return normalizedMeanSquaredErrorWeightingFactor * nmse + falseNegativeRateWeightingFactor * falseNegativeRate + falsePositiveRateWeightingFactor * falsePositiveRate;
     }
 
@@ -105,5 +138,5 @@
 
       double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper,
-                                      problemData, rows, ApplyLinearScalingParameter.ActualValue.Value, ModelCreatorParameter.ActualValue, NormalizedMeanSquaredErrorWeightingFactorParameter.Value.Value, BetaParameter.Value.Value, GammaParameter.Value.Value);
+                                      problemData, rows, ApplyLinearScalingParameter.ActualValue.Value, ModelCreatorParameter.ActualValue, NormalizedMeanSquaredErrorWeightingFactorParameter.Value.Value, FalseNegativeRateWeightingFactor, FalsePositiveRateWeightingFactor);
 
       SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
