Table of Contents

Class RTrees

Namespace
Emgu.CV.ML
Assembly
Emgu.CV.dll

Random trees

public class RTrees : UnmanagedObject, IDisposable, IStatModel, IAlgorithm
Inheritance
RTrees
Implements
Inherited Members
Extension Methods

Constructors

RTrees()

Create a random tree

public RTrees()

Properties

ActiveVarCount

The size of the randomly selected subset of features at each tree node and that are used to find the best split(s)

public int ActiveVarCount { get; set; }

Property Value

int

CVFolds

If CVFolds greater than 1 then algorithms prunes the built decision tree using K-fold

public int CVFolds { get; set; }

Property Value

int

CalculateVarImportance

If true then variable importance will be calculated

public bool CalculateVarImportance { get; set; }

Property Value

bool

MaxCategories

Cluster possible values of a categorical variable into K less than or equals maxCategories clusters to find a suboptimal split

public int MaxCategories { get; set; }

Property Value

int

MaxDepth

The maximum possible depth of the tree

public int MaxDepth { get; set; }

Property Value

int

MinSampleCount

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

public int MinSampleCount { get; set; }

Property Value

int

RegressionAccuracy

Termination criteria for regression trees

public float RegressionAccuracy { get; set; }

Property Value

float

TermCriteria

The termination criteria that specifies when the training algorithm stops

public MCvTermCriteria TermCriteria { get; set; }

Property Value

MCvTermCriteria

TruncatePrunedTree

If true then pruned branches are physically removed from the tree

public bool TruncatePrunedTree { get; set; }

Property Value

bool

Use1SERule

If true then a pruning will be harsher

public bool Use1SERule { get; set; }

Property Value

bool

UseSurrogates

If true then surrogate splits will be built

public bool UseSurrogates { get; set; }

Property Value

bool

Methods

DisposeObject()

Release the random tree and all memory associate with it

protected override void DisposeObject()

GetVotes(IInputArray, IOutputArray, Flags)

Returns the result of each individual tree in the forest. In case the model is a regression problem, the method will return each of the trees' results for each of the sample cases.If the model is a classifier, it will return a Mat with samples + 1 rows, where the first row gives the class number and the following rows return the votes each class had for each sample.

public void GetVotes(IInputArray samples, IOutputArray results, DTrees.Flags flags)

Parameters

samples IInputArray

Array containing the samples for which votes will be calculated.

results IOutputArray

Array where the result of the calculation will be written.

flags DTrees.Flags

Flags for defining the type of RTrees.