Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/15/15 17:00:37 (9 years ago)
Author:
ehopf
Message:

#2361: Minor naming changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SensitivityEvaluator/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveWeightedResidualsMeanSquaredErrorEvaluator.cs

    r12416 r12448  
    3232namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
    3333  [Item("Weighted Residuals Mean Squared Error Evaluator", @"A modified mean squared error evaluator that enables the possibility to weight residuals differently.
    34 The first residual category belongs to estimated values which obviously belong to a specific class because the estimated value is located above the maximum or below the minimum of all the class values (ObviousResidualsWeight).
     34The first residual category belongs to estimated values which definitely belong to a specific class because the estimated value is located above the maximum or below the minimum of all the class values (DefiniteResidualsWeight).
    3535The second residual category represents residuals which belong to the positive class whereby the estimated value is located between the positive and a negative class (PositiveClassResidualsWeight).
    36 All other cases are represented by the third category (NegativeClassResidualsWeight).
     36All other cases are represented by the third category (NegativeClassesResidualsWeight).
    3737The weight is multiplied to the error before squaring which means that the Evaluator acts like a normal MSE-Evaluator if all the weights are set to 1.")]
    3838  [StorableClass]
    3939  public class SymbolicClassificationSingleObjectiveWeightedResidualsMeanSquaredErrorEvaluator : SymbolicClassificationSingleObjectiveEvaluator {
    40     private const string ObviousResidualsWeightParameterName = "ObviousResidualsWeight";
     40    private const string DefiniteResidualsWeightParameterName = "DefiniteResidualsWeight";
    4141    private const string PositiveClassResidualsWeightParameterName = "PositiveClassResidualsWeight";
    42     private const string NegativeClassResidualsWeightParameterName = "NegativeClassResidualsWeight";
     42    private const string NegativeClassesResidualsWeightParameterName = "NegativeClassesResidualsWeight";
    4343    [StorableConstructor]
    4444    protected SymbolicClassificationSingleObjectiveWeightedResidualsMeanSquaredErrorEvaluator(bool deserializing) : base(deserializing) { }
     
    5252    public SymbolicClassificationSingleObjectiveWeightedResidualsMeanSquaredErrorEvaluator()
    5353      : base() {
    54       Parameters.Add(new FixedValueParameter<DoubleValue>(ObviousResidualsWeightParameterName, "Weight of residuals which obviously belong to a specific class because the estimated values is located above the maximum or below the minimum of all the class values.", new DoubleValue(1)));
     54      Parameters.Add(new FixedValueParameter<DoubleValue>(DefiniteResidualsWeightParameterName, "Weight of residuals which definitely belong to a specific class because the estimated values is located above the maximum or below the minimum of all the class values.", new DoubleValue(1)));
    5555      Parameters.Add(new FixedValueParameter<DoubleValue>(PositiveClassResidualsWeightParameterName, "Weight of residuals which belong to the positive class whereby the estimated value is located between the positive and a negative class.", new DoubleValue(1)));
    56       Parameters.Add(new FixedValueParameter<DoubleValue>(NegativeClassResidualsWeightParameterName, "Weight of residuals which are not covered by the ObviousResidualsWeight or the PositiveClassResidualsWeight.", new DoubleValue(1)));
     56      Parameters.Add(new FixedValueParameter<DoubleValue>(NegativeClassesResidualsWeightParameterName, "Weight of residuals which are not covered by the DefiniteResidualsWeight or the PositiveClassResidualsWeight.", new DoubleValue(1)));
    5757    }
    5858
    5959    #region parameter properties
    60     public IFixedValueParameter<DoubleValue> ObviousResidualsWeightParameter {
    61       get { return (IFixedValueParameter<DoubleValue>)Parameters[ObviousResidualsWeightParameterName]; }
     60    public IFixedValueParameter<DoubleValue> DefiniteResidualsWeightParameter {
     61      get { return (IFixedValueParameter<DoubleValue>)Parameters[DefiniteResidualsWeightParameterName]; }
    6262    }
    6363    public IFixedValueParameter<DoubleValue> PositiveClassResidualsWeightParameter {
    6464      get { return (IFixedValueParameter<DoubleValue>)Parameters[PositiveClassResidualsWeightParameterName]; }
    6565    }
    66     public IFixedValueParameter<DoubleValue> NegativeClassResidualsWeightParameter {
    67       get { return (IFixedValueParameter<DoubleValue>)Parameters[NegativeClassResidualsWeightParameterName]; }
     66    public IFixedValueParameter<DoubleValue> NegativeClassesResidualsWeightParameter {
     67      get { return (IFixedValueParameter<DoubleValue>)Parameters[NegativeClassesResidualsWeightParameterName]; }
    6868    }
    6969    #endregion
     
    7272    public override bool Maximization { get { return false; } }
    7373
    74     public double ObviousResidualsWeight {
     74    public double DefiniteResidualsWeight {
    7575      get {
    76         return ObviousResidualsWeightParameter.Value.Value;
     76        return DefiniteResidualsWeightParameter.Value.Value;
    7777      }
    7878    }
     
    8282      }
    8383    }
    84     public double NegativeClassResidualsWeight {
     84    public double NegativeClassesResidualsWeight {
    8585      get {
    86         return NegativeClassResidualsWeightParameter.Value.Value;
     86        return NegativeClassesResidualsWeightParameter.Value.Value;
    8787      }
    8888    }
     
    9393      var solution = SymbolicExpressionTreeParameter.ActualValue;
    9494      double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value,
    95         ObviousResidualsWeight, PositiveClassResidualsWeight, NegativeClassResidualsWeight);
     95        DefiniteResidualsWeight, PositiveClassResidualsWeight, NegativeClassesResidualsWeight);
    9696      QualityParameter.ActualValue = new DoubleValue(quality);
    9797      return base.InstrumentedApply();
     
    9999
    100100    public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData problemData, IEnumerable<int> rows, bool applyLinearScaling,
    101       double obviousResidualsWeight, double positiveClassResidualsWeight, double negativeClassResidualsWeight) {
     101      double definiteResidualsWeight, double positiveClassResidualsWeight, double negativeClassesResidualsWeight) {
    102102      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    103103      IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
     
    116116      if (applyLinearScaling) {
    117117        var calculator = new OnlineWeightedResidualsMeanSquaredErrorCalculator(positiveClassValue, classValuesMax, classValuesMin,
    118           obviousResidualsWeight, positiveClassResidualsWeight, negativeClassResidualsWeight);
     118          definiteResidualsWeight, positiveClassResidualsWeight, negativeClassesResidualsWeight);
    119119        CalculateWithScaling(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, calculator, problemData.Dataset.Rows);
    120120        errorState = calculator.ErrorState;
     
    123123        IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
    124124        quality = OnlineWeightedResidualsMeanSquaredErrorCalculator.Calculate(targetValues, boundedEstimatedValues, positiveClassValue, classValuesMax,
    125           classValuesMin, obviousResidualsWeight, positiveClassResidualsWeight, negativeClassResidualsWeight, out errorState);
     125          classValuesMin, definiteResidualsWeight, positiveClassResidualsWeight, negativeClassesResidualsWeight, out errorState);
    126126      }
    127127      if (errorState != OnlineCalculatorError.None) return Double.NaN;
     
    134134      ApplyLinearScalingParameter.ExecutionContext = context;
    135135
    136       double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows, ApplyLinearScalingParameter.ActualValue.Value, ObviousResidualsWeight, PositiveClassResidualsWeight, NegativeClassResidualsWeight);
     136      double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows, ApplyLinearScalingParameter.ActualValue.Value, DefiniteResidualsWeight, PositiveClassResidualsWeight, NegativeClassesResidualsWeight);
    137137
    138138      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
Note: See TracChangeset for help on using the changeset viewer.