Changeset 6234
- Timestamp:
- 05/19/11 15:45:34 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs
r6233 r6234 145 145 } else { 146 146 var mainBranch = startNode.GetSubtree(0); 147 var product = MakeProduct(mainBranch, beta);148 147 startNode.RemoveSubtree(0); 149 startNode.AddSubtree(product); 150 151 var scaledMainBranch = MakeSum(product, alpha); 152 startNode.RemoveSubtree(0); 148 var scaledMainBranch = MakeSum(MakeProduct(mainBranch, beta), alpha); 153 149 startNode.AddSubtree(scaledMainBranch); 154 150 } … … 159 155 return treeNode; 160 156 } else { 161 var addition = treeNode.Grammar.Symbols.OfType<Addition>().FirstOrDefault(); 162 if (addition == null) addition = new Addition(); 157 var addition = new Addition(); 163 158 var node = addition.CreateTreeNode(); 164 159 var alphaConst = MakeConstant(alpha); … … 173 168 return treeNode; 174 169 } else { 175 var multipliciation = treeNode.Grammar.Symbols.OfType<Multiplication>().FirstOrDefault(); 176 if (multipliciation == null) multipliciation = new Multiplication(); 170 var multipliciation = new Multiplication(); 177 171 var node = multipliciation.CreateTreeNode(); 178 172 var betaConst = MakeConstant(beta); -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs
r6233 r6234 21 21 22 22 using System.Collections.Generic; 23 using System.Linq;24 23 using HeuristicLab.Common; 25 24 using HeuristicLab.Core; … … 95 94 } else { 96 95 var mainBranch = startNode.GetSubtree(0); 97 var product = MakeProduct(mainBranch, beta);98 96 startNode.RemoveSubtree(0); 99 startNode.AddSubtree(product); 100 101 var scaledMainBranch = MakeSum(product, alpha); 102 startNode.RemoveSubtree(0); 97 var scaledMainBranch = MakeSum(MakeProduct(mainBranch, beta), alpha); 103 98 startNode.AddSubtree(scaledMainBranch); 104 99 } … … 109 104 return treeNode; 110 105 } else { 111 var addition = treeNode.Grammar.Symbols.OfType<Addition>().FirstOrDefault(); 112 if (addition == null) addition = new Addition(); 106 var addition = new Addition(); 113 107 var node = addition.CreateTreeNode(); 114 108 var alphaConst = MakeConstant(alpha); … … 123 117 return treeNode; 124 118 } else { 125 var multipliciation = treeNode.Grammar.Symbols.OfType<Multiplication>().FirstOrDefault(); 126 if (multipliciation == null) multipliciation = new Multiplication(); 119 var multipliciation = new Multiplication(); 127 120 var node = multipliciation.CreateTreeNode(); 128 121 var betaConst = MakeConstant(beta);
Note: See TracChangeset
for help on using the changeset viewer.