Changeset 5733 for branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Timestamp:
- 03/17/11 14:07:47 (14 years ago)
- Location:
- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj
r5729 r5733 111 111 <Compile Include="SymbolicRegressionModel.cs" /> 112 112 <Compile Include="Interfaces\ISymbolicRegressionModel.cs" /> 113 <Compile Include="Interfaces\ISymbolicRegressionProblem.cs" />114 <Compile Include="Interfaces\ISymbolicRegressionSingleObjectiveProblem.cs" />115 113 <Compile Include="Interfaces\ISymbolicRegressionSolution.cs" /> 116 114 <Compile Include="Interfaces\ISymbolicRegressionEvaluator.cs" /> -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs
r5722 r5733 31 31 [StorableClass] 32 32 [Creatable("Problems")] 33 public class SymbolicRegressionMultiObjectiveProblem : SymbolicDataAnalysisMultiObjectiveProblem<IRegressionProblemData, ISymbolicRegressionMultiObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator> {33 public class SymbolicRegressionMultiObjectiveProblem : SymbolicDataAnalysisMultiObjectiveProblem<IRegressionProblemData, ISymbolicRegressionMultiObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IRegressionProblem { 34 34 private const double PunishmentFactor = 10; 35 35 private const int InitialMaximumTreeDepth = 8; -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs
r5722 r5733 31 31 [StorableClass] 32 32 [Creatable("Problems")] 33 public class SymbolicRegressionSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, ISymbolicRegressionSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator> {33 public class SymbolicRegressionSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, ISymbolicRegressionSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>,IRegressionProblem { 34 34 private const double PunishmentFactor = 10; 35 35 private const int InitialMaximumTreeDepth = 8; -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs
r5729 r5733 73 73 ConstantTreeNode betaTreeNode = null; 74 74 // check if model has been scaled previously by analyzing the structure of the tree 75 var startNode = Model.SymbolicExpressionTree.Root.GetSub Tree(0);76 if (startNode.GetSub Tree(0).Symbol is Addition) {77 var addNode = startNode.GetSub Tree(0);78 if (addNode.SubtreesCount == 2 && addNode.GetSub Tree(0).Symbol is Multiplication && addNode.GetSubTree(1).Symbol is Constant) {79 alphaTreeNode = addNode.GetSub Tree(1) as ConstantTreeNode;80 var mulNode = addNode.GetSub Tree(0);81 if (mulNode.SubtreesCount == 2 && mulNode.GetSub Tree(1).Symbol is Constant) {82 betaTreeNode = mulNode.GetSub Tree(1) as ConstantTreeNode;75 var startNode = Model.SymbolicExpressionTree.Root.GetSubtree(0); 76 if (startNode.GetSubtree(0).Symbol is Addition) { 77 var addNode = startNode.GetSubtree(0); 78 if (addNode.SubtreesCount == 2 && addNode.GetSubtree(0).Symbol is Multiplication && addNode.GetSubtree(1).Symbol is Constant) { 79 alphaTreeNode = addNode.GetSubtree(1) as ConstantTreeNode; 80 var mulNode = addNode.GetSubtree(0); 81 if (mulNode.SubtreesCount == 2 && mulNode.GetSubtree(1).Symbol is Constant) { 82 betaTreeNode = mulNode.GetSubtree(1) as ConstantTreeNode; 83 83 } 84 84 } … … 90 90 alphaTreeNode.Value += alpha; 91 91 } else { 92 var mainBranch = startNode.GetSub Tree(0);93 startNode.RemoveSub Tree(0);92 var mainBranch = startNode.GetSubtree(0); 93 startNode.RemoveSubtree(0); 94 94 var scaledMainBranch = MakeSum(MakeProduct(beta, mainBranch), alpha); 95 startNode.AddSub Tree(scaledMainBranch);95 startNode.AddSubtree(scaledMainBranch); 96 96 } 97 97 … … 105 105 var node = (new Addition()).CreateTreeNode(); 106 106 var alphaConst = MakeConstant(alpha); 107 node.AddSub Tree(treeNode);108 node.AddSub Tree(alphaConst);107 node.AddSubtree(treeNode); 108 node.AddSubtree(alphaConst); 109 109 return node; 110 110 } … … 117 117 var node = (new Multiplication()).CreateTreeNode(); 118 118 var betaConst = MakeConstant(beta); 119 node.AddSub Tree(treeNode);120 node.AddSub Tree(betaConst);119 node.AddSubtree(treeNode); 120 node.AddSubtree(betaConst); 121 121 return node; 122 122 }
Note: See TracChangeset
for help on using the changeset viewer.