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 SummaryFields Modifier and Type Field Description static intPREDICT_AUTOstatic intPREDICT_MASKstatic intPREDICT_MAX_VOTEstatic intPREDICT_SUM- 
Fields inherited from class org.opencv.ml.StatModelCOMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedDTrees(long addr)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DTrees__fromPtr__(long addr)static DTreescreate()Creates the empty model The static method creates empty decision tree with the specified parameters.protected voidfinalize()intgetCVFolds()SEE: setCVFoldsintgetMaxCategories()SEE: setMaxCategoriesintgetMaxDepth()SEE: setMaxDepthintgetMinSampleCount()SEE: setMinSampleCountMatgetPriors()SEE: setPriorsfloatgetRegressionAccuracy()SEE: setRegressionAccuracybooleangetTruncatePrunedTree()SEE: setTruncatePrunedTreebooleangetUse1SERule()SEE: setUse1SERulebooleangetUseSurrogates()SEE: setUseSurrogatesstatic DTreesload(java.lang.String filepath)Loads and creates a serialized DTrees from a file Use DTree::save to serialize and store an DTree to disk.static DTreesload(java.lang.String filepath, java.lang.String nodeName)Loads and creates a serialized DTrees from a file Use DTree::save to serialize and store an DTree to disk.voidsetCVFolds(int val)getCVFolds SEE: getCVFoldsvoidsetMaxCategories(int val)getMaxCategories SEE: getMaxCategoriesvoidsetMaxDepth(int val)getMaxDepth SEE: getMaxDepthvoidsetMinSampleCount(int val)getMinSampleCount SEE: getMinSampleCountvoidsetPriors(Mat val)getPriors SEE: getPriorsvoidsetRegressionAccuracy(float val)getRegressionAccuracy SEE: getRegressionAccuracyvoidsetTruncatePrunedTree(boolean val)getTruncatePrunedTree SEE: getTruncatePrunedTreevoidsetUse1SERule(boolean val)getUse1SERule SEE: getUse1SERulevoidsetUseSurrogates(boolean val)getUseSurrogates SEE: getUseSurrogates- 
Methods inherited from class org.opencv.ml.StatModelcalcError, empty, getVarCount, isClassifier, isTrained, predict, predict, predict, train, train, train
 - 
Methods inherited from class org.opencv.core.Algorithmclear, getDefaultName, getNativeObjAddr, save
 
- 
 
- 
- 
- 
Field Detail- 
PREDICT_AUTOpublic static final int PREDICT_AUTO - See Also:
- Constant Field Values
 
 - 
PREDICT_SUMpublic static final int PREDICT_SUM - See Also:
- Constant Field Values
 
 - 
PREDICT_MAX_VOTEpublic static final int PREDICT_MAX_VOTE - See Also:
- Constant Field Values
 
 - 
PREDICT_MASKpublic static final int PREDICT_MASK - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
__fromPtr__public static DTrees __fromPtr__(long addr) 
 - 
getMaxCategoriespublic int getMaxCategories() SEE: setMaxCategories- Returns:
- automatically generated
 
 - 
setMaxCategoriespublic void setMaxCategories(int val) getMaxCategories SEE: getMaxCategories- Parameters:
- val- automatically generated
 
 - 
getMaxDepthpublic int getMaxDepth() SEE: setMaxDepth- Returns:
- automatically generated
 
 - 
setMaxDepthpublic void setMaxDepth(int val) getMaxDepth SEE: getMaxDepth- Parameters:
- val- automatically generated
 
 - 
getMinSampleCountpublic int getMinSampleCount() SEE: setMinSampleCount- Returns:
- automatically generated
 
 - 
setMinSampleCountpublic void setMinSampleCount(int val) getMinSampleCount SEE: getMinSampleCount- Parameters:
- val- automatically generated
 
 - 
getCVFoldspublic int getCVFolds() SEE: setCVFolds- Returns:
- automatically generated
 
 - 
setCVFoldspublic void setCVFolds(int val) getCVFolds SEE: getCVFolds- Parameters:
- val- automatically generated
 
 - 
getUseSurrogatespublic boolean getUseSurrogates() SEE: setUseSurrogates- Returns:
- automatically generated
 
 - 
setUseSurrogatespublic void setUseSurrogates(boolean val) getUseSurrogates SEE: getUseSurrogates- Parameters:
- val- automatically generated
 
 - 
getUse1SERulepublic boolean getUse1SERule() SEE: setUse1SERule- Returns:
- automatically generated
 
 - 
setUse1SERulepublic void setUse1SERule(boolean val) getUse1SERule SEE: getUse1SERule- Parameters:
- val- automatically generated
 
 - 
getTruncatePrunedTreepublic boolean getTruncatePrunedTree() SEE: setTruncatePrunedTree- Returns:
- automatically generated
 
 - 
setTruncatePrunedTreepublic void setTruncatePrunedTree(boolean val) getTruncatePrunedTree SEE: getTruncatePrunedTree- Parameters:
- val- automatically generated
 
 - 
getRegressionAccuracypublic float getRegressionAccuracy() SEE: setRegressionAccuracy- Returns:
- automatically generated
 
 - 
setRegressionAccuracypublic void setRegressionAccuracy(float val) getRegressionAccuracy SEE: getRegressionAccuracy- Parameters:
- val- automatically generated
 
 - 
getPriorspublic Mat getPriors() SEE: setPriors- Returns:
- automatically generated
 
 - 
setPriorspublic void setPriors(Mat val) getPriors SEE: getPriors- Parameters:
- val- automatically generated
 
 - 
createpublic static DTrees 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
 
 - 
loadpublic static DTrees load(java.lang.String filepath, java.lang.String nodeName) 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
- nodeName- name of node containing the classifier
- Returns:
- automatically generated
 
 - 
loadpublic static DTrees load(java.lang.String filepath) 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
 
 
- 
 
-