Changeset 14368


Ignore:
Timestamp:
11/02/16 21:11:57 (10 months ago)
Author:
gkronber
Message:

#2690: recalculate RF if required before extracting a specific tree

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs

    r14345 r14368  
    202202
    203203    public ISymbolicExpressionTree ExtractTree(int treeIdx) {
     204      var rf = RandomForest;
    204205      // hoping that the internal representation of alglib is stable
    205206
     
    214215      int offset = 0;
    215216      for (int i = 0; i < treeIdx - 1; i++) {
    216         offset = offset + (int)Math.Round(randomForest.innerobj.trees[offset]);
     217        offset = offset + (int)Math.Round(rf.innerobj.trees[offset]);
    217218      }
    218219
     
    220221      var varCondSy = new VariableCondition() { IgnoreSlope = true };
    221222
    222       var node = CreateRegressionTreeRec(randomForest.innerobj.trees, offset, offset + 1, constSy, varCondSy);
     223      var node = CreateRegressionTreeRec(rf.innerobj.trees, offset, offset + 1, constSy, varCondSy);
    223224
    224225      var startNode = new StartSymbol().CreateTreeNode();
Note: See TracChangeset for help on using the changeset viewer.