Skip to content

Commit

Permalink
Merge pull request #3511 from rcurtin/class-probabilities-decision-tree
Browse files Browse the repository at this point in the history
Add ClassProbabilities() member to DecisionTree.
  • Loading branch information
rcurtin committed Jul 9, 2023
2 parents 9b89f79 + f91697c commit 10109e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
### mlpack ?.?.?
###### ????-??-??
* Reinforcement Learning: Ornstein-Uhlenbeck noise (#3499).

* Reinforcement Learning: Deep Deterministic Policy Gradient (#3494).


* Add `ClassProbabilities()` member to `DecisionTree` so that the internal
details of trees can be more easily inspected (#3511).

### mlpack 4.2.0
###### 2023-06-14
* Adapt C_ReLU, ReLU6, FlexibleReLU layer for new neural network API (#3445).
Expand Down
5 changes: 5 additions & 0 deletions src/mlpack/methods/decision_tree/decision_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 10109e8

Please sign in to comment.