Package org.opencv.ml
Class DTrees
java.lang.Object
org.opencv.core.Algorithm
org.opencv.ml.StatModel
org.opencv.ml.DTrees
public class DTrees extends StatModel
The class represents a single decision tree or a collection of decision trees.
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.
SEE: REF: ml_intro_trees
-
Field Summary
Fields Modifier and Type Field Description static int
PREDICT_AUTO
static int
PREDICT_MASK
static int
PREDICT_MAX_VOTE
static int
PREDICT_SUM
Fields inherited from class org.opencv.ml.StatModel
COMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL
-
Constructor Summary
Constructors Modifier Constructor Description protected
DTrees(long addr)
-
Method Summary
Modifier and Type Method Description static DTrees
__fromPtr__(long addr)
static DTrees
create()
Creates the empty model The static method creates empty decision tree with the specified parameters.protected void
finalize()
int
getCVFolds()
SEE: setCVFoldsint
getMaxCategories()
SEE: setMaxCategoriesint
getMaxDepth()
SEE: setMaxDepthint
getMinSampleCount()
SEE: setMinSampleCountMat
getPriors()
SEE: setPriorsfloat
getRegressionAccuracy()
SEE: setRegressionAccuracyboolean
getTruncatePrunedTree()
SEE: setTruncatePrunedTreeboolean
getUse1SERule()
SEE: setUse1SERuleboolean
getUseSurrogates()
SEE: setUseSurrogatesstatic DTrees
load(String filepath)
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, String nodeName)
Loads and creates a serialized DTrees from a file Use DTree::save to serialize and store an DTree to disk.void
setCVFolds(int val)
getCVFolds SEE: getCVFoldsvoid
setMaxCategories(int val)
getMaxCategories SEE: getMaxCategoriesvoid
setMaxDepth(int val)
getMaxDepth SEE: getMaxDepthvoid
setMinSampleCount(int val)
getMinSampleCount SEE: getMinSampleCountvoid
setPriors(Mat val)
getPriors SEE: getPriorsvoid
setRegressionAccuracy(float val)
getRegressionAccuracy SEE: getRegressionAccuracyvoid
setTruncatePrunedTree(boolean val)
getTruncatePrunedTree SEE: getTruncatePrunedTreevoid
setUse1SERule(boolean val)
getUse1SERule SEE: getUse1SERulevoid
setUseSurrogates(boolean val)
getUseSurrogates SEE: getUseSurrogatesMethods inherited from class org.opencv.ml.StatModel
calcError, empty, getVarCount, isClassifier, isTrained, predict, predict, predict, train, train, train
Methods inherited from class org.opencv.core.Algorithm
clear, getDefaultName, getNativeObjAddr, save
-
Field Details
-
PREDICT_AUTO
- See Also:
- Constant Field Values
-
PREDICT_SUM
- See Also:
- Constant Field Values
-
PREDICT_MAX_VOTE
- See Also:
- Constant Field Values
-
PREDICT_MASK
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
__fromPtr__
-
getMaxCategories
SEE: setMaxCategories- Returns:
- automatically generated
-
setMaxCategories
getMaxCategories SEE: getMaxCategories- Parameters:
val
- automatically generated
-
getMaxDepth
SEE: setMaxDepth- Returns:
- automatically generated
-
setMaxDepth
getMaxDepth SEE: getMaxDepth- Parameters:
val
- automatically generated
-
getMinSampleCount
SEE: setMinSampleCount- Returns:
- automatically generated
-
setMinSampleCount
getMinSampleCount SEE: getMinSampleCount- Parameters:
val
- automatically generated
-
getCVFolds
SEE: setCVFolds- Returns:
- automatically generated
-
setCVFolds
getCVFolds SEE: getCVFolds- Parameters:
val
- automatically generated
-
getUseSurrogates
SEE: setUseSurrogates- Returns:
- automatically generated
-
setUseSurrogates
getUseSurrogates SEE: getUseSurrogates- Parameters:
val
- automatically generated
-
getUse1SERule
SEE: setUse1SERule- Returns:
- automatically generated
-
setUse1SERule
getUse1SERule SEE: getUse1SERule- Parameters:
val
- automatically generated
-
getTruncatePrunedTree
SEE: setTruncatePrunedTree- Returns:
- automatically generated
-
setTruncatePrunedTree
getTruncatePrunedTree SEE: getTruncatePrunedTree- Parameters:
val
- automatically generated
-
getRegressionAccuracy
SEE: setRegressionAccuracy- Returns:
- automatically generated
-
setRegressionAccuracy
getRegressionAccuracy SEE: getRegressionAccuracy- Parameters:
val
- automatically generated
-
getPriors
SEE: setPriors- Returns:
- automatically generated
-
setPriors
getPriors SEE: getPriors- Parameters:
val
- automatically generated
-
create
Creates the empty model 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<DTrees>(filename).- Returns:
- automatically generated
-
load
Loads and creates a serialized DTrees from a file Use DTree::save to serialize and store an DTree to disk. Load the DTree from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier- Parameters:
filepath
- path to serialized DTreenodeName
- name of node containing the classifier- Returns:
- automatically generated
-
load
Loads and creates a serialized DTrees from a file Use DTree::save to serialize and store an DTree to disk. Load the DTree from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier- Parameters:
filepath
- path to serialized DTree- Returns:
- automatically generated
-
finalize
-