@Namespace(value="cv::ml") public static class opencv_ml.DTrees extends opencv_ml.StatModel
The current public interface of the class allows user to train only a single decision tree, however the class is capable of storing multiple decision trees and using them for prediction (by summing responses or using a voting schemes), and the derived from DTrees classes (such as RTrees and Boost) use this capability to implement decision tree ensembles.
\sa \ref ml_intro_trees
| Modifier and Type | Class and Description |
|---|---|
static class |
opencv_ml.DTrees.Node
\brief The class represents a decision tree node.
|
static class |
opencv_ml.DTrees.Split
\brief The class represents split in a decision tree.
|
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator| Modifier and Type | Field and Description |
|---|---|
static int |
PREDICT_AUTO
enum cv::ml::DTrees::Flags
|
static int |
PREDICT_MASK
enum cv::ml::DTrees::Flags
|
static int |
PREDICT_MAX_VOTE
enum cv::ml::DTrees::Flags
|
static int |
PREDICT_SUM
enum cv::ml::DTrees::Flags
|
COMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL| Constructor and Description |
|---|
DTrees(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static opencv_ml.DTrees |
create()
\brief Creates the empty model
|
int |
getCVFolds() |
int |
getMaxCategories() |
int |
getMaxDepth() |
int |
getMinSampleCount() |
opencv_ml.DTrees.Node |
getNodes()
\brief Returns all the nodes
|
opencv_core.Mat |
getPriors() |
float |
getRegressionAccuracy() |
IntPointer |
getRoots()
\brief Returns indices of root nodes
|
opencv_ml.DTrees.Split |
getSplits()
\brief Returns all the splits
|
IntPointer |
getSubsets()
\brief Returns all the bitsets for categorical splits
|
boolean |
getTruncatePrunedTree() |
boolean |
getUse1SERule() |
boolean |
getUseSurrogates() |
void |
setCVFolds(int val)
\copybrief getCVFolds @see getCVFolds
|
void |
setMaxCategories(int val)
\copybrief getMaxCategories @see getMaxCategories
|
void |
setMaxDepth(int val)
\copybrief getMaxDepth @see getMaxDepth
|
void |
setMinSampleCount(int val)
\copybrief getMinSampleCount @see getMinSampleCount
|
void |
setPriors(opencv_core.Mat val)
\copybrief getPriors @see getPriors
|
void |
setRegressionAccuracy(float val)
\copybrief getRegressionAccuracy @see getRegressionAccuracy
|
void |
setTruncatePrunedTree(boolean val)
\copybrief getTruncatePrunedTree @see getTruncatePrunedTree
|
void |
setUse1SERule(boolean val)
\copybrief getUse1SERule @see getUse1SERule
|
void |
setUseSurrogates(boolean val)
\copybrief getUseSurrogates @see getUseSurrogates
|
calcError, calcError, empty, getVarCount, isClassifier, isTrained, predict, predict, predict, predict, train, train, train, trainloadANN_MLP, loadANN_MLP, loadBoost, loadBoost, loadDTrees, loadDTrees, loadEM, loadEM, loadKNearest, loadKNearest, loadLogisticRegression, loadLogisticRegression, loadNormalBayesClassifier, loadNormalBayesClassifier, loadRTrees, loadRTrees, loadSVM, loadSVMclear, getDefaultName, position, read, save, save, writeaddress, asBuffer, asByteBuffer, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, free, hashCode, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, physicalBytes, position, put, realloc, setNull, sizeof, toString, totalBytes, withDeallocator, zeropublic static final int PREDICT_AUTO
public static final int PREDICT_SUM
public static final int PREDICT_MAX_VOTE
public static final int PREDICT_MASK
public DTrees(Pointer p)
Pointer.Pointer(Pointer).public int getMaxCategories()
setMaxCategoriespublic void setMaxCategories(int val)
public int getMaxDepth()
setMaxDepthpublic void setMaxDepth(int val)
public int getMinSampleCount()
setMinSampleCountpublic void setMinSampleCount(int val)
public int getCVFolds()
setCVFoldspublic void setCVFolds(int val)
public void setUseSurrogates(@Cast(value="bool") boolean val)
public void setUse1SERule(@Cast(value="bool") boolean val)
@Cast(value="bool") public boolean getTruncatePrunedTree()
setTruncatePrunedTreepublic void setTruncatePrunedTree(@Cast(value="bool") boolean val)
public float getRegressionAccuracy()
setRegressionAccuracypublic void setRegressionAccuracy(float val)
@ByVal public opencv_core.Mat getPriors()
setPriorspublic void setPriors(@Const @ByRef opencv_core.Mat val)
@StdVector public IntPointer getRoots()
@StdVector public opencv_ml.DTrees.Node getNodes()
all the node indices are indices in the returned vector
@StdVector public opencv_ml.DTrees.Split getSplits()
all the split indices are indices in the returned vector
@StdVector public IntPointer getSubsets()
Split::subsetOfs is an offset in the returned vector
@opencv_core.Ptr public static opencv_ml.DTrees create()
The static method creates empty decision tree with the specified parameters. It should be then
trained using train method (see StatModel::train). Alternatively, you can load the model from
file using Algorithm::load\
Copyright © 2017. All rights reserved.