Table of Contents

Class DTrees

Namespace
OpenCvSharp.ML
Assembly
OpenCvSharp.dll

Decision tree

public class DTrees : StatModel, IDisposable
Inheritance
DTrees
Implements
Derived
Inherited Members

Constructors

DTrees(nint, nint, Action<nint>)

Constructor for the factory pattern (cv::Ptr<T>* + raw T*).

Properties

CVFolds

If CVFolds &gt; 1 then algorithms prunes the built decision tree using K-fold cross-validation procedure where K is equal to CVFolds. Default value is 10.

MaxCategories

Cluster possible values of a categorical variable into K < =maxCategories clusters to find a suboptimal split.

MaxDepth

The maximum possible depth of the tree.

MinSampleCount

If the number of samples in a node is less than this parameter then the node will not be split. Default value is 10.

Priors

The array of a priori class probabilities, sorted by the class label value.

RegressionAccuracy

Termination criteria for regression trees. If all absolute differences between an estimated value in a node and values of train samples in this node are less than this parameter then the node will not be split further. Default value is 0.01f.

TruncatePrunedTree

If true then pruned branches are physically removed from the tree. Otherwise they are retained and it is possible to get results from the original unpruned (or pruned less aggressively) tree. Default value is true.

Use1SERule

If true then a pruning will be harsher. This will make a tree more compact and more resistant to the training data noise but a bit less accurate. Default value is true.

UseSurrogates

If true then surrogate splits will be built. These splits allow to work with missing data and compute variable importance correctly. Default value is false.

Methods

Create()

Creates the empty model.

GetNodes()

Returns all the nodes. all the node indices are indices in the returned vector

GetRoots()

Returns indices of root nodes

GetSplits()

Returns all the splits. all the split indices are indices in the returned vector

GetSubsets()

Returns all the bitsets for categorical splits. Split::subsetOfs is an offset in the returned vector

Load(string)

Loads and creates a serialized model from a file.

LoadFromString(string)

Loads algorithm from a String.