Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/16/13 13:13:41 (11 years ago)
Author:
spimming
Message:

#1888:

  • Merged revisions from trunk
Location:
branches/OaaS
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/OaaS

  • branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views

    • Property svn:mergeinfo set to (toggle deleted branches)
      /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Viewsmergedeligible
      /branches/Algorithms.GradientDescent/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views5516-5520
      /branches/Benchmarking/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views6917-7005
      /branches/CloningRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views4656-4721
      /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views5700-5808
      /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views5471-5808
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views5815-6180
      /branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views4458-4459,​4462,​4464
      /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views6284-6795
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views5060
      /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views8916-8942
      /branches/NET40/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views5138-5162
      /branches/ParallelEngine/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views5175-5192
      /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views7568-7810
      /branches/QAPAlgorithms/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views6350-6627
      /branches/Restructure trunk solution/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views6828
      /branches/RuntimeOptimizer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views8943-9078
      /branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views7787-8333
      /branches/SlaveShutdown/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views8944-8956
      /branches/SuccessProgressAnalysis/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views5370-5682
      /branches/Trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views6829-6865
      /branches/UnloadJobs/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views9168-9215
      /branches/VNS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views5594-5752
      /branches/histogram/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views5959-6341
  • branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4

    • Property svn:ignore
      •  

        old new  
        55*.vs10x
        66Plugin.cs
         7*.user
  • branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.csproj

    r7122 r9363  
    284284  -->
    285285  <PropertyGroup>
    286     <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     286   <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    287287set ProjectDir=$(ProjectDir)
    288288set SolutionDir=$(SolutionDir)
     
    291291call PreBuildEvent.cmd
    292292</PreBuildEvent>
     293<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     294export ProjectDir=$(ProjectDir)
     295export SolutionDir=$(SolutionDir)
     296
     297$SolutionDir/PreBuildEvent.sh
     298</PreBuildEvent>
    293299  </PropertyGroup>
    294300</Project>
  • branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs

    r8139 r9363  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using HeuristicLab.Common;
    2625using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2726using HeuristicLab.Problems.DataAnalysis.Symbolic.Views;
     
    2928namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
    3029  public partial class InteractiveSymbolicRegressionSolutionSimplifierView : InteractiveSymbolicDataAnalysisSolutionSimplifierView {
    31     private readonly ConstantTreeNode constantNode;
    32     private readonly SymbolicExpressionTree tempTree;
     30    private readonly SymbolicRegressionSolutionImpactValuesCalculator calculator;
    3331
    3432    public new SymbolicRegressionSolution Content {
     
    4139      InitializeComponent();
    4240      this.Caption = "Interactive Regression Solution Simplifier";
    43 
    44       constantNode = ((ConstantTreeNode)new Constant().CreateTreeNode());
    45       ISymbolicExpressionTreeNode root = new ProgramRootSymbol().CreateTreeNode();
    46       ISymbolicExpressionTreeNode start = new StartSymbol().CreateTreeNode();
    47       root.AddSubtree(start);
    48       tempTree = new SymbolicExpressionTree(root);
     41      calculator = new SymbolicRegressionSolutionImpactValuesCalculator();
    4942    }
    5043
    5144    protected override void UpdateModel(ISymbolicExpressionTree tree) {
    52       var model = new SymbolicRegressionModel(tree, Content.Model.Interpreter);
    53       SymbolicRegressionModel.Scale(model, Content.ProblemData);
     45      var model = new SymbolicRegressionModel(tree, Content.Model.Interpreter, Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit);
     46      model.Scale(Content.ProblemData);
    5447      Content.Model = model;
    5548    }
    5649
    5750    protected override Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree) {
    58       Dictionary<ISymbolicExpressionTreeNode, double> replacementValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
    59       foreach (ISymbolicExpressionTreeNode node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) {
    60         replacementValues[node] = CalculateReplacementValue(node, tree);
    61       }
    62       return replacementValues;
     51      return tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToDictionary(
     52        n => n,
     53        n => calculator.CalculateReplacementValue(Content.Model, n, Content.ProblemData, Content.ProblemData.TrainingIndices)
     54        );
    6355    }
    6456
    6557    protected override Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree) {
    66       var interpreter = Content.Model.Interpreter;
    67       var dataset = Content.ProblemData.Dataset;
    68       var rows = Content.ProblemData.TrainingIndices;
    69       string targetVariable = Content.ProblemData.TargetVariable;
    70       Dictionary<ISymbolicExpressionTreeNode, double> impactValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
    71       List<ISymbolicExpressionTreeNode> nodes = tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPostfix().ToList();
    72       var originalOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows)
    73         .ToArray();
    74       var targetValues = dataset.GetDoubleValues(targetVariable, rows);
    75       OnlineCalculatorError errorState;
    76       double originalR2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, originalOutput, out errorState);
    77       if (errorState != OnlineCalculatorError.None) originalR2 = 0.0;
    78 
    79       foreach (ISymbolicExpressionTreeNode node in nodes) {
    80         var parent = node.Parent;
    81         constantNode.Value = CalculateReplacementValue(node, tree);
    82         ISymbolicExpressionTreeNode replacementNode = constantNode;
    83         SwitchNode(parent, node, replacementNode);
    84         var newOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows);
    85         double newR2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, newOutput, out errorState);
    86         if (errorState != OnlineCalculatorError.None) newR2 = 0.0;
    87 
    88         // impact = 0 if no change
    89         // impact < 0 if new solution is better
    90         // impact > 0 if new solution is worse
    91         impactValues[node] = originalR2 - newR2;
    92         SwitchNode(parent, replacementNode, node);
    93       }
    94       return impactValues;
    95     }
    96 
    97     private double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree) {
    98       // remove old ADFs
    99       while (tempTree.Root.SubtreeCount > 1) tempTree.Root.RemoveSubtree(1);
    100       // clone ADFs of source tree
    101       for (int i = 1; i < sourceTree.Root.SubtreeCount; i++) {
    102         tempTree.Root.AddSubtree((ISymbolicExpressionTreeNode)sourceTree.Root.GetSubtree(i).Clone());
    103       }
    104       var start = tempTree.Root.GetSubtree(0);
    105       while (start.SubtreeCount > 0) start.RemoveSubtree(0);
    106       start.AddSubtree((ISymbolicExpressionTreeNode)node.Clone());
    107       var interpreter = Content.Model.Interpreter;
    108       var rows = Content.ProblemData.TrainingIndices;
    109       return interpreter.GetSymbolicExpressionTreeValues(tempTree, Content.ProblemData.Dataset, rows).Median();
    110     }
    111 
    112 
    113     private void SwitchNode(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode oldBranch, ISymbolicExpressionTreeNode newBranch) {
    114       for (int i = 0; i < root.SubtreeCount; i++) {
    115         if (root.GetSubtree(i) == oldBranch) {
    116           root.RemoveSubtree(i);
    117           root.InsertSubtree(i, newBranch);
    118           return;
    119         }
    120       }
     58      return tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToDictionary(
     59        n => n,
     60        n => calculator.CalculateImpactValue(Content.Model, n, Content.ProblemData, Content.ProblemData.TrainingIndices, Content.TrainingRSquared)
     61        );
    12162    }
    12263
    12364    protected override void btnOptimizeConstants_Click(object sender, EventArgs e) {
    124       SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(Content.Model.Interpreter, Content.Model.SymbolicExpressionTree, Content.ProblemData, Content.ProblemData.TrainingIndices, 0.001, 0, 0.0001);
     65      var model = Content.Model;
     66      SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(model.Interpreter, model.SymbolicExpressionTree, Content.ProblemData, Content.ProblemData.TrainingIndices,
     67        applyLinearScaling: true, maxIterations: 50, upperEstimationLimit: model.UpperEstimationLimit, lowerEstimationLimit: model.LowerEstimationLimit);
    12568      UpdateModel(Content.Model.SymbolicExpressionTree);
    12669    }
  • branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/Plugin.cs.frame

    r7259 r9363  
    2626
    2727namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
    28   [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views", "Provides views for symbolic regression problem classes.", "3.4.2.$WCREV$")]
     28  [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views", "Provides views for symbolic regression problem classes.", "3.4.3.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.dll",PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Algorithms.DataAnalysis", "3.4")]
  • branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/Properties/AssemblyInfo.cs.frame

    r7259 r9363  
    5353// by using the '*' as shown below:
    5454[assembly: AssemblyVersion("3.4.0.0")]
    55 [assembly: AssemblyFileVersion("3.4.2.$WCREV$")]
     55[assembly: AssemblyFileVersion("3.4.3.$WCREV$")]
  • branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.Designer.cs

    r8100 r9363  
    1 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
    223  partial class SymbolicRegressionSolutionErrorCharacteristicsCurveView {
    324    /// <summary>
  • branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.Designer.cs

    r5829 r9363  
    1 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
    223  partial class SymbolicRegressionSolutionView {
    324    /// <summary>
  • branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/VariableTrackbar.Designer.cs

    r7967 r9363  
    1 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
    223  partial class VariableTrackbar {
    324    /// <summary>
  • branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/VariableTrackbar.cs

    r7028 r9363  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324using System.ComponentModel;
Note: See TracChangeset for help on using the changeset viewer.