Class RTrees
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
CVFolds
If CVFolds greater than 1 then algorithms prunes the built decision tree using K-fold
public int CVFolds { get; set; }
Property Value
CalculateVarImportance
If true then variable importance will be calculated
public bool CalculateVarImportance { get; set; }
Property Value
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
MaxDepth
The maximum possible depth of the tree
public int MaxDepth { get; set; }
Property Value
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
RegressionAccuracy
Termination criteria for regression trees
public float RegressionAccuracy { get; set; }
Property Value
TermCriteria
The termination criteria that specifies when the training algorithm stops
public MCvTermCriteria TermCriteria { get; set; }
Property Value
TruncatePrunedTree
If true then pruned branches are physically removed from the tree
public bool TruncatePrunedTree { get; set; }
Property Value
Use1SERule
If true then a pruning will be harsher
public bool Use1SERule { get; set; }
Property Value
UseSurrogates
If true then surrogate splits will be built
public bool UseSurrogates { get; set; }
Property Value
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
IInputArrayArray containing the samples for which votes will be calculated.
results
IOutputArrayArray where the result of the calculation will be written.
flags
DTrees.FlagsFlags for defining the type of RTrees.