Training Parameters of Random Trees
Inheritance Hierarchy
OpenCvSharpDisposableObject
OpenCvSharpDisposableCvObject
OpenCvSharp.CPlusPlusCvDTreeParams
OpenCvSharp.CPlusPlusCvRTParams
Namespace: OpenCvSharp.CPlusPlus
Assembly: OpenCvSharp.CPlusPlus (in OpenCvSharp.CPlusPlus.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
The CvRTParams type exposes the following members.
Constructors
Name | Description | |
---|---|---|
CvRTParams |
Default constructor
| |
CvRTParams(IntPtr) | Initializes a new instance of the CvRTParams class | |
CvRTParams(Int32, Int32, Single, Boolean, Int32, Single, Boolean, Int32, CvTermCriteria) |
Training constructor
|
Properties
Name | Description | |
---|---|---|
AllocatedMemory |
Gets or sets a memory address allocated by AllocMemory.
(Inherited from DisposableObject.) | |
AllocatedMemorySize |
Gets or sets the byte length of the allocated memory
(Inherited from DisposableObject.) | |
CalcVarImportance |
If it is set, then variable importance is computed by the training procedure. To retrieve the computed variable importance array, call the method CvRTrees::get_var_importance().
| |
CvFolds |
If this parameter is >1, the tree is pruned using cv_folds-fold cross validation.
(Inherited from CvDTreeParams.) | |
CvPtr |
Native pointer of OpenCV structure
(Inherited from DisposableCvObject.) | |
IsDisposed |
Gets a value indicating whether this instance has been disposed.
(Inherited from DisposableObject.) | |
IsEnabledDispose |
Gets or sets a value indicating whether you permit disposing this instance.
(Inherited from DisposableObject.) | |
MaxCategories |
If a discrete variable, on which the training procedure tries to make a split, takes more than MaxCategories values,
the precise best subset estimation may take a very long time (as the algorithm is exponential).
Instead, many decision trees engines (including ML) try to find sub-optimal split in this case by clustering
all the samples into MaxCategories clusters (i.e. some categories are merged together).
Note that this technique is used only in N(>2)-class classification problems. In case of regression and 2-class classification
the optimal split can be found efficiently without employing clustering, thus the parameter is not used in these cases.
(Inherited from CvDTreeParams.) | |
MaxDepth |
This parameter specifies the maximum possible depth of the tree. That is the training algorithms attempts to split a node
while its depth is less than max_depth. The actual depth may be smaller if the other termination criteria are met
(see the outline of the training procedure in the beginning of the section), and/or if the tree is pruned.
(Inherited from CvDTreeParams.) | |
MinSampleCount |
A node is not split if the number of samples directed to the node is less than the parameter value.
(Inherited from CvDTreeParams.) | |
NactiveVars |
The number of variables that are randomly selected at each tree node and that are used to find the best split(s).
| |
Priors |
The array of a priori class probabilities, sorted by the class label value.
The parameter can be used to tune the decision tree preferences toward a certain class.
For example, if users want to detect some rare anomaly occurrence, the training base will likely contain much more normal cases
than anomalies, so a very good classification performance will be achieved just by considering every case as normal.
To avoid this, the priors can be specified, where the anomaly probability is artificially increased (up to 0.5 or even greater),
so the weight of the misclassified anomalies becomes much bigger, and the tree is adjusted properly.
(Inherited from CvDTreeParams.) | |
RegressionAccuracy |
Another stop criteria - only for regression trees. As soon as the estimated node value differs
from the node training samples responses by less than the parameter value, the node is not split further.
(Inherited from CvDTreeParams.) | |
TermCrit |
Termination criteria for growing the forest:
term_crit.max_iter is the maximum number of trees in the forest (see also max_tree_count parameter of the constructor, by default it is set to 50)
term_crit.epsilon is the sufficient accuracy (OOB error).
| |
TruncatePrunedTree |
If true, the cut off nodes (with Tn≤CvDTree::pruned_tree_idx) are physically removed from the tree.
Otherwise they are kept, and by decreasing CvDTree::PrunedTreeIdx (e.g. setting it to -1)
it is still possible to get the results from the original un-pruned (or pruned less aggressively) tree.
(Inherited from CvDTreeParams.) | |
Use1seRule |
If true, the tree is truncated a bit more by the pruning procedure.
That leads to compact, and more resistant to the training data noise, but a bit less accurate decision tree.
(Inherited from CvDTreeParams.) | |
UseSurrogates |
If true, surrogate splits are built. Surrogate splits are needed to handle missing measurements and for variable importance estimation.
(Inherited from CvDTreeParams.) |
Methods
Name | Description | |
---|---|---|
AllocGCHandle |
Pins the object to be allocated by cvSetData.
(Inherited from DisposableObject.) | |
AllocMemory |
Allocates the specified size of memory.
(Inherited from DisposableObject.) | |
Dispose |
Releases the resources
(Inherited from DisposableObject.) | |
Dispose(Boolean) |
Clean up any resources being used.
(Overrides CvDTreeParamsDispose(Boolean).) | |
Equals | (Inherited from Object.) | |
Finalize |
Destructor
(Inherited from DisposableObject.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
MemberwiseClone | (Inherited from Object.) | |
NotifyMemoryPressure |
Notifies the allocated size of memory.
(Inherited from DisposableObject.) | |
ThrowIfDisposed |
If this object is disposed, then ObjectDisposedException is thrown.
(Inherited from DisposableObject.) | |
ToString | (Inherited from Object.) |
Fields
Name | Description | |
---|---|---|
dataHandle |
Gets or sets a handle which allocates using cvSetData.
(Inherited from DisposableObject.) | |
handle | (Inherited from CvDTreeParams.) | |
priors | (Inherited from CvDTreeParams.) | |
ptr |
Data pointer
(Inherited from DisposableCvObject.) |
See Also