13 #ifndef MLPACK_METHODS_DET_DT_UTILS_HPP
14 #define MLPACK_METHODS_DET_DT_UTILS_HPP
33 template <
typename MatType,
typename TagType>
36 const arma::Mat<size_t>& labels,
37 const size_t numClasses,
48 template <
typename MatType,
typename TagType>
65 template <
typename MatType,
typename TagType>
68 const bool useVolumeReg =
false,
69 const size_t maxLeafSize = 10,
70 const size_t minLeafSize = 5,
72 const bool skipPruning =
false);
102 template<
typename MatType>
108 template<
typename MatType>
115 template<
typename MatType>
148 #include "dt_utils_impl.hpp"
150 #endif // MLPACK_METHODS_DET_DT_UTILS_HPP
std::string BuildString()
void Enter(const DTree< MatType, int > *node, const DTree< MatType, int > *parent)
Enter a given node.
This class is responsible for caching the path to each node of the tree.
The core includes that mlpack expects; standard C++ includes and Armadillo.
std::vector< std::pair< int, std::string > > PathCacheType
DTree< MatType, TagType > * Trainer(MatType &dataset, const size_t folds, const bool useVolumeReg=false, const size_t maxLeafSize=10, const size_t minLeafSize=5, const std::string unprunedTreeOutput="", const bool skipPruning=false)
Train the optimal decision tree using cross-validation with the given number of folds.
const std::string & PathFor(int tag) const
Return the constructed path for a given tag.
int ParentOf(int tag) const
Get the parent tag of a given tag.
Print only whether we went left or right.
void Leave(const DTree< MatType, int > *node, const DTree< MatType, int > *parent)
Leave the given node.
void PrintLeafMembership(DTree< MatType, TagType > *dtree, const MatType &data, const arma::Mat< size_t > &labels, const size_t numClasses, const std::string &leafClassMembershipFile="")
Print the membership of leaves of a density estimation tree given the labels and number of classes...
PathFormat
Possible formats to use for output.
A density estimation tree is similar to both a decision tree and a space partitioning tree (like a kd...
std::list< std::pair< bool, int > > PathType
PathCacher(PathFormat fmt, DTree< MatType, int > *tree)
Construct a PathCacher object on the given tree with the given format.
Print the direction, then the tag of the node.
Print the tag of the node, then the direction.
void PrintVariableImportance(const DTree< MatType, TagType > *dtree, const std::string viFile="")
Print the variable importance of each dimension of a density estimation tree.
src mlpack core util version hpp VERSION_HPP_CONTENTS string(REGEX REPLACE".*#define MLPACK_VERSION_MAJOR ([0-9]+).*""\\1"MLPACK_VERSION_MAJOR"${VERSION_HPP_CONTENTS}") string(REGEX REPLACE".* MLPACK_VERSION_MINOR "$
size_t NumNodes() const
Get the number of nodes in the path cache.