---
name: "mlpack_det"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_det/3"
---

# mlpack\_det(3)

Density Estimation Trees.

## NAME

mlpack::det -

Density Estimation Trees.

## SYNOPSIS

### Classes

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

### Functions

void **PrintLeafMembership** (**DTree** \*dtree, const arma::mat &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.*  void **PrintVariableImportance** (const **DTree** \*dtree, const std::string viFile='')\
 *Print the variable importance of each dimension of a density estimation tree.*  **DTree** \* **Trainer** (arma::mat &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.*

## Detailed Description

Density Estimation Trees.

## Function Documentation

### void mlpack::det::PrintLeafMembership (DTree \*dtree, const arma::mat &data, const arma::Mat\< size\_t \> &labels, const size\_tnumClasses, const std::stringleafClassMembershipFile = `''`)

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:**

*dtree* Tree to print membership of. \
 *data* Dataset tree is built upon. \
 *labels* Class labels of dataset. \
 *numClasses* Number of classes in dataset. \
 *leafClassMembershipFile* Name of file to print to (optional).

### void mlpack::det::PrintVariableImportance (const DTree \*dtree, const std::stringviFile = `''`)

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:**

*dtree* Density tree to use. \
 *viFile* Name of file to print to (optional).

### DTree\* mlpack::det::Trainer (arma::mat &dataset, const size\_tfolds, const booluseVolumeReg = `false`, const size\_tmaxLeafSize = `10`, const size\_tminLeafSize = `5`, const std::stringunprunedTreeOutput = `''`)

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:**

*dataset* Dataset for the tree to use. \
 *folds* Number of folds to use for cross-validation. \
 *useVolumeReg* If true, use volume regularization. \
 *maxLeafSize* Maximum number of points allowed in a leaf. \
 *minLeafSize* Minimum number of points allowed in a leaf. \
 *unprunedTreeOutput* Filename to print unpruned tree to (optional).

## Author

Generated automatically by Doxygen for MLPACK from the source code.
