@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.
|
| 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(org.bytedeco.javacpp.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() |
org.bytedeco.javacpp.IntPointer |
getRoots()
\brief Returns indices of root nodes
|
opencv_ml.DTrees.Split |
getSplits()
\brief Returns all the splits
|
org.bytedeco.javacpp.IntPointer |
getSubsets()
\brief Returns all the bitsets for categorical splits
|
boolean |
getTruncatePrunedTree() |
boolean |
getUse1SERule() |
boolean |
getUseSurrogates() |
static opencv_ml.DTrees |
load(org.bytedeco.javacpp.BytePointer filepath) |
static opencv_ml.DTrees |
load(org.bytedeco.javacpp.BytePointer filepath,
org.bytedeco.javacpp.BytePointer nodeName)
\brief Loads and creates a serialized DTrees from a file
Use DTree::save to serialize and store an DTree to disk.
|
static opencv_ml.DTrees |
load(String filepath) |
static opencv_ml.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(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, calcError, empty, getVarCount, isClassifier, isTrained, predict, predict, predict, predict, predict, predict, train, 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, write, write, writeaddress, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, 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(org.bytedeco.javacpp.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)
@Cast(value="bool") public boolean getUseSurrogates()
setUseSurrogatespublic void setUseSurrogates(@Cast(value="bool")
boolean val)
@Cast(value="bool") public boolean getUse1SERule()
setUse1SERulepublic 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 org.bytedeco.javacpp.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 org.bytedeco.javacpp.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\
@opencv_core.Ptr public static opencv_ml.DTrees load(@opencv_core.Str org.bytedeco.javacpp.BytePointer filepath, @opencv_core.Str org.bytedeco.javacpp.BytePointer nodeName)
filepath - path to serialized DTreenodeName - name of node containing the classifier@opencv_core.Ptr public static opencv_ml.DTrees load(@opencv_core.Str org.bytedeco.javacpp.BytePointer filepath)
@opencv_core.Ptr public static opencv_ml.DTrees load(@opencv_core.Str String filepath, @opencv_core.Str String nodeName)
@opencv_core.Ptr public static opencv_ml.DTrees load(@opencv_core.Str String filepath)
Copyright © 2018. All rights reserved.