diff --git a/gtsam/discrete/DecisionTree-inl.h b/gtsam/discrete/DecisionTree-inl.h index 58de338a8..16a926271 100644 --- a/gtsam/discrete/DecisionTree-inl.h +++ b/gtsam/discrete/DecisionTree-inl.h @@ -627,7 +627,7 @@ namespace gtsam { NodePtr fi = compose(functions.begin(), functions.end(), label); choiceOnHighestLabel->push_back(fi); } - return Choice::Unique(choiceOnHighestLabel); + return choiceOnHighestLabel; } } @@ -691,8 +691,8 @@ namespace gtsam { } /****************************************************************************/ - // Take a range of labels and a corresponding range of values, - // and creates a decision tree. + // Top-level factory method, which takes a range of labels and a corresponding + // range of values, and creates a decision tree. template template typename DecisionTree::NodePtr DecisionTree::create( diff --git a/gtsam/discrete/DecisionTree.h b/gtsam/discrete/DecisionTree.h index a2b05070b..a5d890ab5 100644 --- a/gtsam/discrete/DecisionTree.h +++ b/gtsam/discrete/DecisionTree.h @@ -142,8 +142,10 @@ namespace gtsam { template NodePtr build(It begin, It end, ValueIt beginY, ValueIt endY) const; - /** Internal helper function to create from keys, cardinalities, - * and Y values + /** Internal helper function to create from + * keys, cardinalities, and Y values. + * Calls `build` which builds thetree bottom-up, + * before we prune in a top-down fashion. */ template NodePtr create(It begin, It end, ValueIt beginY, ValueIt endY) const;