Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/19/15 14:15:19 (8 years ago)
Author:
gkronber
Message:

#2175 made some changes while reviewing the code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/PearsonRSquaredNumberOfVariablesEvaluator.cs

    r13241 r13300  
    4444    public PearsonRSquaredNumberOfVariablesEvaluator() : base() { }
    4545
    46     public override IEnumerable<bool> Maximization { get { return new bool[2] { true, false }; } }
     46    public override IEnumerable<bool> Maximization { get { return new bool[2] { true, false }; } } // maximize R² and minimize the number of variables
    4747
    4848    public override IOperation InstrumentedApply() {
     
    6666      if (decimalPlaces >= 0)
    6767        r2 = Math.Round(r2, decimalPlaces);
    68       return new double[2] { r2, solution.IterateNodesPostfix().OfType<VariableTreeNode>().Count() };
     68      return new double[2] { r2, solution.IterateNodesPostfix().OfType<VariableTreeNode>().Count() }; // count the number of variables
    6969    }
    7070
     
    7373      EstimationLimitsParameter.ExecutionContext = context;
    7474      ApplyLinearScalingParameter.ExecutionContext = context;
     75      // DecimalPlaces parameter is a FixedValueParameter and doesn't need the context.
    7576
    7677      double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows, ApplyLinearScalingParameter.ActualValue.Value, DecimalPlaces);
Note: See TracChangeset for help on using the changeset viewer.