From a7c5a3ba2323df5769d08fc28b21ec65cd2d2bf5 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Fri, 7 Jul 2023 11:04:02 -0400 Subject: [PATCH] Add ClassProbabilities() member to DecisionTree. --- src/mlpack/methods/decision_tree/decision_tree.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mlpack/methods/decision_tree/decision_tree.hpp b/src/mlpack/methods/decision_tree/decision_tree.hpp index 695c8dc152..dd1a486d0b 100644 --- a/src/mlpack/methods/decision_tree/decision_tree.hpp +++ b/src/mlpack/methods/decision_tree/decision_tree.hpp @@ -470,6 +470,11 @@ class DecisionTree : //! trained tree). size_t SplitDimension() const { return splitDimension; } + //! Get the class probabilities, if this is a leaf node in the trained tree. + //! Note that if this is not a leaf, then this may contain arbitrary + //! information used by the split in the tree! + const arma::vec& ClassProbabilities() const { return classProbabilities; } + /** * Given a point and that this node is not a leaf, calculate the index of the * child node this point would go towards. This method is primarily used by