Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/08/15 09:52:09 (9 years ago)
Author:
gkronber
Message:

#2392: merged r12492 and r12641 from trunk to stable

Location:
stable
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs

    r12009 r12669  
    5757      OnlineCalculatorError errorState;
    5858
    59       double r2;
     59      double r;
    6060      if (applyLinearScaling) {
    61         var r2Calculator = new OnlinePearsonsRSquaredCalculator();
    62         CalculateWithScaling(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, r2Calculator, problemData.Dataset.Rows);
    63         errorState = r2Calculator.ErrorState;
    64         r2 = r2Calculator.RSquared;
     61        var rCalculator = new OnlinePearsonsRCalculator();
     62        CalculateWithScaling(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, rCalculator, problemData.Dataset.Rows);
     63        errorState = rCalculator.ErrorState;
     64        r = rCalculator.R;
    6565      } else {
    6666        IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
    67         r2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState);
     67        r = OnlinePearsonsRCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState);
    6868      }
    6969
    70       if (errorState != OnlineCalculatorError.None) r2 = double.NaN;
    71       return new double[2] { r2, solution.Length };
     70      if (errorState != OnlineCalculatorError.None) r = double.NaN;
     71      return new double[2] { r*r, solution.Length };
    7272    }
    7373
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.cs

    r12009 r12669  
    5959      OnlineCalculatorError errorState;
    6060
    61       double r2;
     61      double r;
    6262      if (applyLinearScaling) {
    63         var r2Calculator = new OnlinePearsonsRSquaredCalculator();
    64         CalculateWithScaling(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, r2Calculator, problemData.Dataset.Rows);
    65         errorState = r2Calculator.ErrorState;
    66         r2 = r2Calculator.RSquared;
     63        var rCalculator = new OnlinePearsonsRCalculator();
     64        CalculateWithScaling(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, rCalculator, problemData.Dataset.Rows);
     65        errorState = rCalculator.ErrorState;
     66        r = rCalculator.R;
    6767      } else {
    6868        IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
    69         r2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState);
     69        r = OnlinePearsonsRCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState);
    7070      }
    7171      if (errorState != OnlineCalculatorError.None) return double.NaN;
    72       return r2;
     72      return r*r;
    7373    }
    7474
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningOperator.cs

    r12009 r12669  
    6060      var targetValues = ProblemData.Dataset.GetDoubleValues(regressionProblemData.TargetVariable, trainingIndices);
    6161      OnlineCalculatorError errorState;
    62       var quality = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, estimatedValues, out errorState);
     62      var quality = OnlinePearsonsRCalculator.Calculate(targetValues, estimatedValues, out errorState);
    6363      if (errorState != OnlineCalculatorError.None) return double.NaN;
    64       return quality;
     64      return quality*quality;
    6565    }
    6666  }
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolutionImpactValuesCalculator.cs

    r12009 r12669  
    6666      if (double.IsNaN(originalQuality)) {
    6767        var originalValues = regressionModel.GetEstimatedValues(dataset, rows);
    68         originalQuality = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, originalValues, out errorState);
     68        originalQuality = OnlinePearsonsRCalculator.Calculate(targetValues, originalValues, out errorState);
    6969        if (errorState != OnlineCalculatorError.None) originalQuality = 0.0;
    7070      }
     
    8383
    8484      var estimatedValues = tempModel.GetEstimatedValues(dataset, rows);
    85       double newQuality = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, estimatedValues, out errorState);
     85      double newQuality = OnlinePearsonsRCalculator.Calculate(targetValues, estimatedValues, out errorState);
    8686      if (errorState != OnlineCalculatorError.None) newQuality = 0.0;
    8787
    88       impactValue = originalQuality - newQuality;
     88      impactValue = (originalQuality*originalQuality) - (newQuality*newQuality);
    8989    }
    9090  }
Note: See TracChangeset for help on using the changeset viewer.