- Timestamp:
- 12/15/21 11:50:57 (3 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/3140_NumberSymbol (added) merged: 18091,18093,18100,18112-18121,18123-18131
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/branches/3140_NumberSymbol/HeuristicLab.Algorithms.DataAnalysis (added) merged: 18100,18113-18114,18116
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:mergeinfo changed
/branches/3140_NumberSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4 (added) merged: 18100,18113-18114,18116
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs
r17180 r18132 230 230 var startSy = new StartSymbol(); 231 231 var varCondSy = new VariableCondition() { IgnoreSlope = true }; 232 var constSy = new Constant();232 var numSy = new Number(); 233 233 234 234 var startNode = startSy.CreateTreeNode(); 235 startNode.AddSubtree(CreateSymbolicRegressionTreeRecursive(tree, 0, varCondSy, constSy));235 startNode.AddSubtree(CreateSymbolicRegressionTreeRecursive(tree, 0, varCondSy, numSy)); 236 236 var rootNode = rootSy.CreateTreeNode(); 237 237 rootNode.AddSubtree(startNode); … … 239 239 } 240 240 241 private ISymbolicExpressionTreeNode CreateSymbolicRegressionTreeRecursive(TreeNode[] treeNodes, int nodeIdx, VariableCondition varCondSy, Constant constSy) {241 private ISymbolicExpressionTreeNode CreateSymbolicRegressionTreeRecursive(TreeNode[] treeNodes, int nodeIdx, VariableCondition varCondSy, Number numSy) { 242 242 var curNode = treeNodes[nodeIdx]; 243 243 if (curNode.VarName == TreeNode.NO_VARIABLE) { 244 var node = ( ConstantTreeNode)constSy.CreateTreeNode();244 var node = (NumberTreeNode)numSy.CreateTreeNode(); 245 245 node.Value = curNode.Val; 246 246 return node; … … 250 250 node.Threshold = curNode.Val; 251 251 252 var left = CreateSymbolicRegressionTreeRecursive(treeNodes, curNode.LeftIdx, varCondSy, constSy);253 var right = CreateSymbolicRegressionTreeRecursive(treeNodes, curNode.RightIdx, varCondSy, constSy);252 var left = CreateSymbolicRegressionTreeRecursive(treeNodes, curNode.LeftIdx, varCondSy, numSy); 253 var right = CreateSymbolicRegressionTreeRecursive(treeNodes, curNode.RightIdx, varCondSy, numSy); 254 254 node.AddSubtree(left); 255 255 node.AddSubtree(right);
Note: See TracChangeset
for help on using the changeset viewer.