Class DTrees
Decision tree
Inheritance
Implements
Inherited Members
Namespace: OpenCvSharp.ML
Assembly: OpenCvSharp.dll
Syntax
public class DTrees : StatModel, ICvPtrHolder
Constructors
| Improve this Doc View SourceDTrees()
Declaration
protected DTrees()
DTrees(IntPtr)
Creates instance by raw pointer cv::ml::SVM*
Declaration
protected DTrees(IntPtr p)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | p |
Properties
| Improve this Doc View SourceCVFolds
If CVFolds > 1 then algorithms prunes the built decision tree using K-fold cross-validation procedure where K is equal to CVFolds. Default value is 10.
Declaration
public int CVFolds { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaxCategories
Cluster possible values of a categorical variable into K < =maxCategories clusters to find a suboptimal split.
Declaration
public int MaxCategories { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaxDepth
The maximum possible depth of the tree.
Declaration
public int MaxDepth { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
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.
Declaration
public int MinSampleCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Priors
The array of a priori class probabilities, sorted by the class label value.
Declaration
public Mat Priors { get; set; }
Property Value
Type | Description |
---|---|
Mat |
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.
Declaration
public float RegressionAccuracy { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
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.
Declaration
public bool TruncatePrunedTree { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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.
Declaration
public bool Use1SERule { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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.
Declaration
public bool UseSurrogates { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceCreate()
Creates the empty model.
Declaration
public static DTrees Create()
Returns
Type | Description |
---|---|
DTrees |
DisposeManaged()
Releases managed resources
Declaration
protected override void DisposeManaged()
Overrides
| Improve this Doc View SourceGetNodes()
Returns all the nodes. all the node indices are indices in the returned vector
Declaration
public DTrees.Node[] GetNodes()
Returns
Type | Description |
---|---|
DTrees.Node[] |
GetRoots()
Returns indices of root nodes
Declaration
public int[] GetRoots()
Returns
Type | Description |
---|---|
System.Int32[] |
GetSplits()
Returns all the splits. all the split indices are indices in the returned vector
Declaration
public DTrees.Split[] GetSplits()
Returns
Type | Description |
---|---|
DTrees.Split[] |
GetSubsets()
Returns all the bitsets for categorical splits. Split::subsetOfs is an offset in the returned vector
Declaration
public int[] GetSubsets()
Returns
Type | Description |
---|---|
System.Int32[] |
Load(String)
Loads and creates a serialized model from a file.
Declaration
public static DTrees Load(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath |
Returns
Type | Description |
---|---|
DTrees |
LoadFromString(String)
Loads algorithm from a String.
Declaration
public static DTrees LoadFromString(string strModel)
Parameters
Type | Name | Description |
---|---|---|
System.String | strModel | he string variable containing the model you want to load. |
Returns
Type | Description |
---|---|
DTrees |