Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/27/14 10:29:38 (10 years ago)
Author:
mkommend
Message:

#2175: Merged trunk changes into complexity branch.

Location:
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression

  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/HLScript/HeuristicLab.Problems.DataAnalysis.Symbolic.Regressionmergedeligible
      /stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regressionmergedeligible
      /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4mergedeligible
      /branches/Benchmarking/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression6917-7005
      /branches/CloningRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression4656-4721
      /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression5471-5473
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression5815-6180
      /branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression4458-4459,​4462,​4464
      /branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression10085-11101
      /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression6284-6795
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression5060
      /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression8388-8942
      /branches/LogResidualEvaluator/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression10202-10483
      /branches/NET40/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression5138-5162
      /branches/ParallelEngine/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression5175-5192
      /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression7748-7810
      /branches/QAPAlgorithms/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression6350-6627
      /branches/Restructure trunk solution/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression6828
      /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression10204-10479
      /branches/SuccessProgressAnalysis/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression5370-5682
      /branches/Trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression6829-6865
      /branches/VNS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression5594-5752
      /branches/histogram/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression5959-6341
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Interfaces/ISymbolicRegressionEvaluator.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Interfaces/ISymbolicRegressionModel.cs

    r9587 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Interfaces/ISymbolicRegressionMultiObjectiveEvaluator.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Interfaces/ISymbolicRegressionSingleObjectiveEvaluator.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Interfaces/ISymbolicRegressionSolution.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveEvaluator.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs

    r10291 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator.cs

    r10750 r11310  
    2525using HeuristicLab.Data;
    2626using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     27using HeuristicLab.Parameters;
    2728using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2829
     
    3132  [StorableClass]
    3233  public class SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator : SymbolicRegressionMultiObjectiveEvaluator {
     34    private string useConstantOptimizationParameterName = "Use constant optimization";
     35
     36    public IFixedValueParameter<BoolValue> UseConstantOptimizationParameter {
     37      get { return (IFixedValueParameter<BoolValue>)Parameters[useConstantOptimizationParameterName]; }
     38    }
     39
     40    public bool UseConstantOptimization {
     41      get { return UseConstantOptimizationParameter.Value.Value; }
     42      set { UseConstantOptimizationParameter.Value.Value = value; }
     43    }
     44
    3345    [StorableConstructor]
    3446    protected SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator(bool deserializing) : base(deserializing) { }
     
    4052    }
    4153
    42     public SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator() : base() { }
     54    public SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator()
     55      : base() {
     56      Parameters.Add(new FixedValueParameter<BoolValue>(useConstantOptimizationParameterName, "", new BoolValue(false)));
     57
     58    }
     59
     60    [StorableHook(HookType.AfterDeserialization)]
     61    private void AfterDeserialization() {
     62      if (!Parameters.ContainsKey(useConstantOptimizationParameterName)) {
     63        Parameters.Add(new FixedValueParameter<BoolValue>(useConstantOptimizationParameterName, "", new BoolValue(false)));
     64      }
     65    }
    4366
    4467    public override IEnumerable<bool> Maximization { get { return new bool[2] { true, false }; } }
     
    4770      IEnumerable<int> rows = GenerateRowsToEvaluate();
    4871      var solution = SymbolicExpressionTreeParameter.ActualValue;
    49       double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value);
     72      var problemData = ProblemDataParameter.ActualValue;
     73      var interpreter = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue;
     74      var estimationLimits = EstimationLimitsParameter.ActualValue;
     75      var applyLinearScaling = ApplyLinearScalingParameter.ActualValue.Value;
     76
     77      if (UseConstantOptimization) {
     78        SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, solution, problemData, rows, applyLinearScaling, 5, estimationLimits.Upper, estimationLimits.Lower);
     79      }
     80      double[] qualities = Calculate(interpreter, solution, estimationLimits.Lower, estimationLimits.Upper, problemData, rows, applyLinearScaling);
    5081      QualitiesParameter.ActualValue = new DoubleArray(qualities);
    5182      return base.InstrumentedApply();
     
    5384
    5485    public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows, bool applyLinearScaling) {
    55       IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    56       IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
    57       OnlineCalculatorError errorState;
    58 
    59       double r2;
    60       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;
    65       } else {
    66         IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
    67         r2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState);
    68       }
    69 
    70       if (errorState != OnlineCalculatorError.None) r2 = double.NaN;
     86      double r2 = SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.Calculate(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, problemData, rows, applyLinearScaling);
    7187      return new double[2] { r2, SymbolicDataAnalysisModelComplexityAnalyzer.CalculateComplexity(solution.Root.GetSubtree(0).GetSubtree(0)) };
    7288    }
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs

    r10291 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    5353
    5454    public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows, bool applyLinearScaling) {
    55       IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    56       IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
    57       OnlineCalculatorError errorState;
    58 
    59       double r2;
    60       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;
    65       } else {
    66         IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
    67         r2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState);
    68       }
    69 
    70       if (errorState != OnlineCalculatorError.None) r2 = double.NaN;
     55      double r2 = SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.Calculate(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, problemData, rows, applyLinearScaling);
    7156      return new double[2] { r2, solution.Length };
    7257    }
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveTrainingBestSolutionAnalyzer.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
     22using System.Collections.Generic;
     23using System.Linq;
     24using HeuristicLab.Analysis;
    2225using HeuristicLab.Common;
    2326using HeuristicLab.Core;
     27using HeuristicLab.Data;
    2428using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     29using HeuristicLab.Optimization;
    2530using HeuristicLab.Parameters;
    2631using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3742    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
    3843    private const string EstimationLimitsParameterName = "EstimationLimits";
     44    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
     45
    3946    #region parameter properties
    4047    public ILookupParameter<IRegressionProblemData> ProblemDataParameter {
     
    4653    public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {
    4754      get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
     55    }
     56    public ILookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
     57      get { return (ILookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
    4858    }
    4959    #endregion
     
    5767      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree."));
    5868      Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic regression model."));
     69      Parameters.Add(new LookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "Maximal length of the symbolic expression."));
     70    }
     71
     72    [StorableHook(HookType.AfterDeserialization)]
     73    private void AfterDeserialization() {
     74      if (!Parameters.ContainsKey(MaximumSymbolicExpressionTreeLengthParameterName))
     75        Parameters.Add(new LookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "Maximal length of the symbolic expression."));
    5976    }
    6077
     
    6885      return new SymbolicRegressionSolution(model, (IRegressionProblemData)ProblemDataParameter.ActualValue.Clone());
    6986    }
     87
     88    public override IOperation Apply() {
     89      var operation = base.Apply();
     90
     91      var paretoFront = TrainingBestSolutionsParameter.ActualValue;
     92
     93      IResult result;
     94      ScatterPlot qualityToTreeSize;
     95      if (!ResultCollection.TryGetValue("Pareto Front Analysis", out result)) {
     96        qualityToTreeSize = new ScatterPlot("Quality vs Tree Size", "");
     97        qualityToTreeSize.VisualProperties.XAxisMinimumAuto = false;
     98        qualityToTreeSize.VisualProperties.XAxisMaximumAuto = false;
     99        qualityToTreeSize.VisualProperties.YAxisMinimumAuto = false;
     100        qualityToTreeSize.VisualProperties.YAxisMaximumAuto = false;
     101
     102        qualityToTreeSize.VisualProperties.XAxisMinimumFixedValue = 0;
     103        qualityToTreeSize.VisualProperties.XAxisMaximumFixedValue = MaximumSymbolicExpressionTreeLengthParameter.ActualValue.Value;
     104        qualityToTreeSize.VisualProperties.YAxisMinimumFixedValue = 0;
     105        qualityToTreeSize.VisualProperties.YAxisMaximumFixedValue = 2;
     106        ResultCollection.Add(new Result("Pareto Front Analysis", qualityToTreeSize));
     107      } else {
     108        qualityToTreeSize = (ScatterPlot)result.Value;
     109      }
     110
     111      var problemData = ProblemDataParameter.ActualValue;
     112      var constantValue = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).Average();
     113      var constantSolution = CreateConstantSymbolicRegressionSolution(constantValue);
     114
     115      int previousTreeLength = constantSolution.Model.SymbolicExpressionTree.Length;
     116      var sizeParetoFront = new LinkedList<ISymbolicRegressionSolution>();
     117      sizeParetoFront.AddLast(constantSolution);
     118
     119      foreach (var solution in paretoFront.OrderBy(s => s.Model.SymbolicExpressionTree.Length)) {
     120        int treeLength = solution.Model.SymbolicExpressionTree.Length;
     121        if (!sizeParetoFront.Any()) sizeParetoFront.AddLast(solution);
     122        if (solution.TrainingNormalizedMeanSquaredError < sizeParetoFront.Last.Value.TrainingNormalizedMeanSquaredError) {
     123          if (treeLength == previousTreeLength)
     124            sizeParetoFront.RemoveLast();
     125          sizeParetoFront.AddLast(solution);
     126        }
     127        previousTreeLength = treeLength;
     128      }
     129
     130      qualityToTreeSize.Rows.Clear();
     131      var trainingRow = new ScatterPlotDataRow("Training NMSE", "", sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length, x.TrainingNormalizedMeanSquaredError)));
     132      trainingRow.VisualProperties.PointSize = 5;
     133      var testRow = new ScatterPlotDataRow("Test NMSE", "", sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length, x.TestNormalizedMeanSquaredError)));
     134      testRow.VisualProperties.PointSize = 5;
     135      qualityToTreeSize.Rows.Add(trainingRow);
     136      qualityToTreeSize.Rows.Add(testRow);
     137
     138      double trainingHyperVolume, testHyperVolume;
     139      CalculateNormalizedHyperVolume(sizeParetoFront, out trainingHyperVolume, out testHyperVolume);
     140
     141      DoubleValue trainingHyperVolumeResult, testHyperVolumeResult;
     142      if (!ResultCollection.TryGetValue("HyperVolume training", out result)) {
     143        trainingHyperVolumeResult = new DoubleValue();
     144        ResultCollection.Add(new Result("HyperVolume training", trainingHyperVolumeResult));
     145      } else trainingHyperVolumeResult = (DoubleValue)result.Value;
     146
     147      if (!ResultCollection.TryGetValue("HyperVolume test", out result)) {
     148        testHyperVolumeResult = new DoubleValue();
     149        ResultCollection.Add(new Result("HyperVolume test", testHyperVolumeResult));
     150      } else testHyperVolumeResult = (DoubleValue)result.Value;
     151
     152      trainingHyperVolumeResult.Value = trainingHyperVolume;
     153      testHyperVolumeResult.Value = testHyperVolume;
     154
     155      return operation;
     156    }
     157
     158    private void CalculateNormalizedHyperVolume(IEnumerable<ISymbolicRegressionSolution> solutions, out double trainingHyperVolume, out double testHyperVolume) {
     159      trainingHyperVolume = 0.0;
     160      testHyperVolume = 0.0;
     161
     162      var prevX = 0;
     163      var prevYTraining = 1.0;
     164      var prevYTest = 1.0;
     165      var treeSize = 0;
     166
     167      foreach (var solution in solutions) {
     168        treeSize = solution.Model.SymbolicExpressionTree.Length;
     169        trainingHyperVolume += (prevYTraining + solution.TrainingNormalizedMeanSquaredError) * (treeSize - prevX) / 2;
     170        testHyperVolume += (prevYTest + solution.TestNormalizedMeanSquaredError) * (treeSize - prevX) / 2;
     171        prevX = treeSize;
     172        prevYTraining = solution.TrainingNormalizedMeanSquaredError;
     173        prevYTest = solution.TestNormalizedMeanSquaredError;
     174      }
     175
     176      trainingHyperVolume = trainingHyperVolume / treeSize;
     177      testHyperVolume = testHyperVolume / treeSize;
     178    }
     179
     180    private ISymbolicRegressionSolution CreateConstantSymbolicRegressionSolution(double constantValue) {
     181      var grammar = new ArithmeticExpressionGrammar();
     182      var rootNode = (SymbolicExpressionTreeTopLevelNode)grammar.ProgramRootSymbol.CreateTreeNode();
     183      var startNode = (SymbolicExpressionTreeTopLevelNode)grammar.StartSymbol.CreateTreeNode();
     184      var constantTreeNode = new ConstantTreeNode(new Constant()) { Value = constantValue };
     185      rootNode.AddSubtree(startNode);
     186      startNode.AddSubtree(constantTreeNode);
     187      var tree = new SymbolicExpressionTree();
     188      tree.Root = rootNode;
     189
     190      var model = new SymbolicRegressionModel(tree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue);
     191      var solution = new SymbolicRegressionSolution(model, ProblemDataParameter.ActualValue);
     192      return solution;
     193    }
    70194  }
    71195}
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Plugin.cs.frame

    r10037 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2626
    2727namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
    28   [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression","Provides classes to perform symbolic regression (single- or multiobjective).", "3.4.5.$WCREV$")]
     28  [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression","Provides classes to perform symbolic regression (single- or multiobjective).", "3.4.6.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")]
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Properties/AssemblyInfo.cs.frame

    r10037 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3131[assembly: AssemblyCompany("")]
    3232[assembly: AssemblyProduct("HeuristicLab")]
    33 [assembly: AssemblyCopyright("(c) 2002-2013 HEAL")]
     33[assembly: AssemblyCopyright("(c) 2002-2014 HEAL")]
    3434[assembly: AssemblyTrademark("")]
    3535[assembly: AssemblyCulture("")]
     
    5353// by using the '*' as shown below:
    5454[assembly: AssemblyVersion("3.4.0.0")]
    55 [assembly: AssemblyFileVersion("3.4.5.$WCREV$")]
     55[assembly: AssemblyFileVersion("3.4.6.$WCREV$")]
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/ConstantOptimizationAnalyzer.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs

    r10291 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionLogResidualEvaluator.cs

    r10486 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionMeanRelativeErrorEvaluator.cs

    r10432 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveEvaluator.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveMaxAbsoluteErrorEvaluator.cs

    r10291 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveMeanAbsoluteErrorEvaluator.cs

    r10291 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.cs

    r10291 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.cs

    r10291 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveOverfittingAnalyzer.cs

    r10576 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs

    r10596 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveTrainingBestSolutionAnalyzer.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveValidationParetoBestSolutionAnalyzer.cs

    r9456 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs

    r9587 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningOperator.cs

    r10469 r11310  
    1 using System.Linq;
     1#region License Information
     2
     3/* HeuristicLab
     4 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     5 *
     6 * This file is part of HeuristicLab.
     7 *
     8 * HeuristicLab is free software: you can redistribute it and/or modify
     9 * it under the terms of the GNU General Public License as published by
     10 * the Free Software Foundation, either version 3 of the License, or
     11 * (at your option) any later version.
     12 *
     13 * HeuristicLab is distributed in the hope that it will be useful,
     14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16 * GNU General Public License for more details.
     17 *
     18 * You should have received a copy of the GNU General Public License
     19 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     20 */
     21
     22#endregion
     23
     24using System.Linq;
    225using HeuristicLab.Common;
    326using HeuristicLab.Core;
     
    1033  public class SymbolicRegressionPruningOperator : SymbolicDataAnalysisExpressionPruningOperator {
    1134    private const string ImpactValuesCalculatorParameterName = "ImpactValuesCalculator";
    12     private const string ImpactValuesCalculatorParameterDescription = "The impact values calculator to be used for figuring out the node impacts.";
    13 
    14     private const string EvaluatorParameterName = "Evaluator";
    15 
    16     public ILookupParameter<ISymbolicRegressionSingleObjectiveEvaluator> EvaluatorParameter {
    17       get { return (ILookupParameter<ISymbolicRegressionSingleObjectiveEvaluator>)Parameters[EvaluatorParameterName]; }
    18     }
    1935
    2036    protected SymbolicRegressionPruningOperator(SymbolicRegressionPruningOperator original, Cloner cloner)
     
    3046    public SymbolicRegressionPruningOperator() {
    3147      var impactValuesCalculator = new SymbolicRegressionSolutionImpactValuesCalculator();
    32       Parameters.Add(new ValueParameter<ISymbolicDataAnalysisSolutionImpactValuesCalculator>(ImpactValuesCalculatorParameterName, ImpactValuesCalculatorParameterDescription, impactValuesCalculator));
    33       Parameters.Add(new LookupParameter<ISymbolicRegressionSingleObjectiveEvaluator>(EvaluatorParameterName));
     48      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisSolutionImpactValuesCalculator>(ImpactValuesCalculatorParameterName, "The impact values calculator to be used for figuring out the node impacts.", impactValuesCalculator));
    3449    }
    3550
     
    4156      var regressionModel = (IRegressionModel)model;
    4257      var regressionProblemData = (IRegressionProblemData)ProblemData;
    43       var trainingIndices = ProblemData.TrainingIndices.ToList();
     58      var trainingIndices = Enumerable.Range(FitnessCalculationPartition.Start, FitnessCalculationPartition.Size);
    4459      var estimatedValues = regressionModel.GetEstimatedValues(ProblemData.Dataset, trainingIndices); // also bounds the values
    4560      var targetValues = ProblemData.Dataset.GetDoubleValues(regressionProblemData.TargetVariable, trainingIndices);
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs

    r10750 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolutionImpactValuesCalculator.cs

    r10469 r11310  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
Note: See TracChangeset for help on using the changeset viewer.