- Timestamp:
- 04/16/13 13:13:41 (11 years ago)
- Location:
- branches/OaaS
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views merged eligible /branches/Algorithms.GradientDescent/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 5516-5520 /branches/Benchmarking/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 6917-7005 /branches/CloningRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 4656-4721 /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 5700-5808 /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 5815-6180 /branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 4458-4459,4462,4464 /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 5060 /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 8916-8942 /branches/NET40/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 5138-5162 /branches/ParallelEngine/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 7568-7810 /branches/QAPAlgorithms/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 6828 /branches/RuntimeOptimizer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 7787-8333 /branches/SlaveShutdown/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 8944-8956 /branches/SuccessProgressAnalysis/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 5370-5682 /branches/Trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 6829-6865 /branches/UnloadJobs/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 9168-9215 /branches/VNS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 5594-5752 /branches/histogram/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4
- Property svn:ignore
-
old new 5 5 *.vs10x 6 6 Plugin.cs 7 *.user
-
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.csproj
r7122 r9363 284 284 --> 285 285 <PropertyGroup> 286 <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)286 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 287 287 set ProjectDir=$(ProjectDir) 288 288 set SolutionDir=$(SolutionDir) … … 291 291 call PreBuildEvent.cmd 292 292 </PreBuildEvent> 293 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 294 export ProjectDir=$(ProjectDir) 295 export SolutionDir=$(SolutionDir) 296 297 $SolutionDir/PreBuildEvent.sh 298 </PreBuildEvent> 293 299 </PropertyGroup> 294 300 </Project> -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs
r8139 r9363 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common;26 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 26 using HeuristicLab.Problems.DataAnalysis.Symbolic.Views; … … 29 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views { 30 29 public partial class InteractiveSymbolicRegressionSolutionSimplifierView : InteractiveSymbolicDataAnalysisSolutionSimplifierView { 31 private readonly ConstantTreeNode constantNode; 32 private readonly SymbolicExpressionTree tempTree; 30 private readonly SymbolicRegressionSolutionImpactValuesCalculator calculator; 33 31 34 32 public new SymbolicRegressionSolution Content { … … 41 39 InitializeComponent(); 42 40 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(); 49 42 } 50 43 51 44 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); 54 47 Content.Model = model; 55 48 } 56 49 57 50 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 ); 63 55 } 64 56 65 57 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 ); 121 62 } 122 63 123 64 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); 125 68 UpdateModel(Content.Model.SymbolicExpressionTree); 126 69 } -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/Plugin.cs.frame
r7259 r9363 26 26 27 27 namespace 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$")] 29 29 [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.dll",PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Algorithms.DataAnalysis", "3.4")] -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/Properties/AssemblyInfo.cs.frame
r7259 r9363 53 53 // by using the '*' as shown below: 54 54 [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 22 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views { 2 23 partial class SymbolicRegressionSolutionErrorCharacteristicsCurveView { 3 24 /// <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 22 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views { 2 23 partial class SymbolicRegressionSolutionView { 3 24 /// <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 22 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views { 2 23 partial class VariableTrackbar { 3 24 /// <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 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.ComponentModel;
Note: See TracChangeset
for help on using the changeset viewer.