Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/15/21 11:50:57 (3 years ago)
Author:
gkronber
Message:

#3140: merged r18091:18131 from branch to trunk

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/HeuristicLab.Algorithms.DataAnalysis

  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4

  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs

    r17180 r18132  
    230230      var startSy = new StartSymbol();
    231231      var varCondSy = new VariableCondition() { IgnoreSlope = true };
    232       var constSy = new Constant();
     232      var numSy = new Number();
    233233
    234234      var startNode = startSy.CreateTreeNode();
    235       startNode.AddSubtree(CreateSymbolicRegressionTreeRecursive(tree, 0, varCondSy, constSy));
     235      startNode.AddSubtree(CreateSymbolicRegressionTreeRecursive(tree, 0, varCondSy, numSy));
    236236      var rootNode = rootSy.CreateTreeNode();
    237237      rootNode.AddSubtree(startNode);
     
    239239    }
    240240
    241     private ISymbolicExpressionTreeNode CreateSymbolicRegressionTreeRecursive(TreeNode[] treeNodes, int nodeIdx, VariableCondition varCondSy, Constant constSy) {
     241    private ISymbolicExpressionTreeNode CreateSymbolicRegressionTreeRecursive(TreeNode[] treeNodes, int nodeIdx, VariableCondition varCondSy, Number numSy) {
    242242      var curNode = treeNodes[nodeIdx];
    243243      if (curNode.VarName == TreeNode.NO_VARIABLE) {
    244         var node = (ConstantTreeNode)constSy.CreateTreeNode();
     244        var node = (NumberTreeNode)numSy.CreateTreeNode();
    245245        node.Value = curNode.Val;
    246246        return node;
     
    250250        node.Threshold = curNode.Val;
    251251
    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);
    254254        node.AddSubtree(left);
    255255        node.AddSubtree(right);
Note: See TracChangeset for help on using the changeset viewer.