mlpack  master
Classes | Functions
mlpack::det Namespace Reference

Density Estimation Trees. More...

Classes

class  DTree
 A density estimation tree is similar to both a decision tree and a space partitioning tree (like a kd-tree). More...
 

Functions

template<typename MatType , typename TagType >
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. More...
 
template<typename MatType , typename TagType >
void PrintVariableImportance (const DTree< MatType, TagType > *dtree, const std::string viFile="")
 Print the variable importance of each dimension of a density estimation tree. More...
 
template<typename MatType , typename TagType >
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="")
 Train the optimal decision tree using cross-validation with the given number of folds. More...
 

Detailed Description

Density Estimation Trees.

Function Documentation

template<typename MatType , typename TagType >
void mlpack::det::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.

Optionally, pass the name of a file to print this information to (otherwise stdout is used).

Parameters
dtreeTree to print membership of.
dataDataset tree is built upon.
labelsClass labels of dataset.
numClassesNumber of classes in dataset.
leafClassMembershipFileName of file to print to (optional).
template<typename MatType , typename TagType >
void mlpack::det::PrintVariableImportance ( const DTree< MatType, TagType > *  dtree,
const std::string  viFile = "" 
)

Print the variable importance of each dimension of a density estimation tree.

Optionally, pass the name of a file to print this information to (otherwise stdout is used).

Parameters
dtreeDensity tree to use.
viFileName of file to print to (optional).
template<typename MatType , typename TagType >
DTree<MatType, TagType>* mlpack::det::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 = "" 
)

Train the optimal decision tree using cross-validation with the given number of folds.

Optionally, give a filename to print the unpruned tree to. This initializes a tree on the heap, so you are responsible for deleting it.

Parameters
datasetDataset for the tree to use.
foldsNumber of folds to use for cross-validation.
useVolumeRegIf true, use volume regularization.
maxLeafSizeMaximum number of points allowed in a leaf.
minLeafSizeMinimum number of points allowed in a leaf.
unprunedTreeOutputFilename to print unpruned tree to (optional).