@Namespace(value="cv::ml") @Properties(inherit=opencv_ml.class) public class DTrees extends 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.
ml_intro_trees
Modifier and Type | Class and Description |
---|---|
static class |
DTrees.Node
\brief The class represents a decision tree node.
|
static class |
DTrees.Split
\brief The class represents split in a decision tree.
|
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
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 DTrees |
create()
\brief Creates the empty model
|
int |
getCVFolds() |
int |
getMaxCategories() |
int |
getMaxDepth() |
int |
getMinSampleCount() |
DTrees.Node |
getNodes()
\brief Returns all the nodes
|
Mat |
getPriors() |
float |
getRegressionAccuracy() |
IntPointer |
getRoots()
\brief Returns indices of root nodes
|
DTrees.Split |
getSplits()
\brief Returns all the splits
|
IntPointer |
getSubsets()
\brief Returns all the bitsets for categorical splits
|
boolean |
getTruncatePrunedTree() |
boolean |
getUse1SERule() |
boolean |
getUseSurrogates() |
static DTrees |
load(BytePointer filepath) |
static DTrees |
load(BytePointer filepath,
BytePointer nodeName)
\brief Loads and creates a serialized DTrees from a file
Use DTree::save to serialize and store an DTree to disk.
|
static DTrees |
load(String filepath) |
static DTrees |
load(String filepath,
String nodeName) |
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(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, calcError, empty, getVarCount, isClassifier, isTrained, predict, predict, predict, predict, predict, predict, train, train, train, train, train
loadANN_MLP, loadANN_MLP, loadBoost, loadBoost, loadDTrees, loadDTrees, loadEM, loadEM, loadKNearest, loadKNearest, loadLogisticRegression, loadLogisticRegression, loadNormalBayesClassifier, loadNormalBayesClassifier, loadRTrees, loadRTrees, loadSVM, loadSVM
clear, getDefaultName, position, read, save, save, write, write, write
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public 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()
setMaxCategories
public void setMaxCategories(int val)
public int getMaxDepth()
setMaxDepth
public void setMaxDepth(int val)
public int getMinSampleCount()
setMinSampleCount
public void setMinSampleCount(int val)
public int getCVFolds()
setCVFolds
public 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()
setTruncatePrunedTree
public void setTruncatePrunedTree(@Cast(value="bool") boolean val)
public float getRegressionAccuracy()
setRegressionAccuracy
public void setRegressionAccuracy(float val)
@StdVector public IntPointer getRoots()
@StdVector public DTrees.Node getNodes()
all the node indices are indices in the returned vector
@StdVector public 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 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\
@opencv_core.Ptr public static DTrees load(@opencv_core.Str BytePointer filepath, @opencv_core.Str BytePointer nodeName)
filepath
- path to serialized DTreenodeName
- name of node containing the classifier@opencv_core.Ptr public static DTrees load(@opencv_core.Str BytePointer filepath)
@opencv_core.Ptr public static DTrees load(@opencv_core.Str String filepath, @opencv_core.Str String nodeName)
@opencv_core.Ptr public static DTrees load(@opencv_core.Str String filepath)
Copyright © 2020. All rights reserved.