Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/16/11 12:00:36 (13 years ago)
Author:
mkommend
Message:

#1479: Integrated trunk changes.

Location:
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs

    r5942 r6784  
    5454    public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) {
    5555      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    56       IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
     56      IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
    5757      IEnumerable<double> boundedEstimationValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
    5858      OnlineCalculatorError errorState;
  • branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs

    r5942 r6784  
    5454    public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) {
    5555      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    56       IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
     56      IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
    5757      OnlineCalculatorError errorState;
    5858      double r2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedValues, originalValues, out errorState);
  • branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs

    r6782 r6784  
    8080
    8181    private void UpdateEstimationLimits() {
    82       if (ProblemData.TrainingPartition.Start < ProblemData.TrainingPartition.End) {
    83         var targetValues = ProblemData.Dataset.GetVariableValues(ProblemData.TargetVariable, ProblemData.TrainingPartition.Start, ProblemData.TrainingPartition.End);
     82      if (ProblemData.TrainingIndizes.Any()) {
     83        var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToList();
    8484        var mean = targetValues.Average();
    8585        var range = targetValues.Max() - targetValues.Min();
    8686        EstimationLimits.Upper = mean + PunishmentFactor * range;
    8787        EstimationLimits.Lower = mean - PunishmentFactor * range;
     88      } else {
     89        EstimationLimits.Upper = double.MaxValue;
     90        EstimationLimits.Lower = double.MinValue;
    8891      }
    8992    }
  • branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.cs

    r5942 r6784  
    5656    public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) {
    5757      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    58       IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
     58      IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
    5959      IEnumerable<double> boundedEstimationValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
    6060      OnlineCalculatorError errorState;
  • branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveOverfittingAnalyzer.cs

    r5907 r6784  
    7979
    8080      double[] trainingQuality = QualityParameter.ActualValue.Select(x => x.Value).ToArray();
     81      var problemData = ProblemDataParameter.ActualValue;
     82      var evaluator = EvaluatorParameter.ActualValue;
    8183      // evaluate on validation partition
    82       IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(EvaluatorParameter.ActualValue);
    83       double[] validationQuality = (from tree in SymbolicExpressionTree
    84                                     select EvaluatorParameter.ActualValue.Evaluate(childContext, tree, ProblemDataParameter.ActualValue, rows))
    85                                    .ToArray();
     84      IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(evaluator);
     85      double[] validationQuality = SymbolicExpressionTree
     86        .AsParallel()
     87        .Select(t => evaluator.Evaluate(childContext, t, problemData, rows))
     88        .ToArray();
    8689      double r = 0.0;
    8790      try {
  • branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.cs

    r5942 r6784  
    5656    public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) {
    5757      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    58       IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
     58      IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
    5959      OnlineCalculatorError errorState;
    6060      double r2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedValues, originalValues, out errorState);
  • branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs

    r6782 r6784  
    7777
    7878    private void UpdateEstimationLimits() {
    79       if (ProblemData.TrainingPartition.Start < ProblemData.TrainingPartition.End) {
    80         var targetValues = ProblemData.Dataset.GetVariableValues(ProblemData.TargetVariable, ProblemData.TrainingPartition.Start, ProblemData.TrainingPartition.End);
     79      if (ProblemData.TrainingIndizes.Any()) {
     80        var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToList();
    8181        var mean = targetValues.Average();
    8282        var range = targetValues.Max() - targetValues.Min();
    8383        EstimationLimits.Upper = mean + PunishmentFactor * range;
    8484        EstimationLimits.Lower = mean - PunishmentFactor * range;
     85      } else {
     86        EstimationLimits.Upper = double.MaxValue;
     87        EstimationLimits.Lower = double.MinValue;
    8588      }
    8689    }
  • branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs

    r6618 r6784  
    7373      var rows = problemData.TrainingIndizes;
    7474      var estimatedValues = model.Interpreter.GetSymbolicExpressionTreeValues(model.SymbolicExpressionTree, dataset, rows);
    75       var targetValues = dataset.GetEnumeratedVariableValues(targetVariable, rows);
     75      var targetValues = dataset.GetDoubleValues(targetVariable, rows);
    7676      double alpha;
    7777      double beta;
Note: See TracChangeset for help on using the changeset viewer.