OpenCV for Unity  2.6.3
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
OpenCVForUnity.MlModule.DTrees Class Reference

The class represents a single decision tree or a collection of decision trees. More...

Inheritance diagram for OpenCVForUnity.MlModule.DTrees:
OpenCVForUnity.MlModule.StatModel OpenCVForUnity.CoreModule.Algorithm OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject OpenCVForUnity.MlModule.Boost OpenCVForUnity.MlModule.RTrees

Public Member Functions

int getMaxCategories ()
 
void setMaxCategories (int val)
 
int getMaxDepth ()
 
void setMaxDepth (int val)
 
int getMinSampleCount ()
 
void setMinSampleCount (int val)
 
int getCVFolds ()
 
void setCVFolds (int val)
 
bool getUseSurrogates ()
 
void setUseSurrogates (bool val)
 
bool getUse1SERule ()
 
void setUse1SERule (bool val)
 
bool getTruncatePrunedTree ()
 
void setTruncatePrunedTree (bool val)
 
float getRegressionAccuracy ()
 
void setRegressionAccuracy (float val)
 
Mat getPriors ()
 
void setPriors (Mat val)
 
- Public Member Functions inherited from OpenCVForUnity.MlModule.StatModel
int getVarCount ()
 Returns the number of variables in training samples. More...
 
override bool empty ()
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. More...
 
bool isTrained ()
 Returns true if the model is trained. More...
 
bool isClassifier ()
 Returns true if the model is classifier. More...
 
bool train (TrainData trainData, int flags)
 Trains the statistical model. More...
 
bool train (TrainData trainData)
 Trains the statistical model. More...
 
bool train (Mat samples, int layout, Mat responses)
 Trains the statistical model. More...
 
float calcError (TrainData data, bool test, Mat resp)
 Computes error on the training or test dataset. More...
 
virtual float predict (Mat samples, Mat results, int flags)
 Predicts response(s) for the provided sample(s) More...
 
virtual float predict (Mat samples, Mat results)
 Predicts response(s) for the provided sample(s) More...
 
virtual float predict (Mat samples)
 Predicts response(s) for the provided sample(s) More...
 
- Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
IntPtr getNativeObjAddr ()
 
virtual void clear ()
 Clears the algorithm state. More...
 
void save (string filename)
 
virtual string getDefaultName ()
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static new DTrees __fromPtr__ (IntPtr addr)
 
static DTrees create ()
 Creates the empty model. More...
 
static DTrees load (string filepath, string nodeName)
 Loads and creates a serialized DTrees from a file. More...
 
static DTrees load (string filepath)
 Loads and creates a serialized DTrees from a file. More...
 
- Static Public Member Functions inherited from OpenCVForUnity.MlModule.StatModel
static new StatModel __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
static Algorithm __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Public Attributes

const int PREDICT_AUTO = 0
 
const int PREDICT_SUM = (1 << 8)
 
const int PREDICT_MAX_VOTE = (2 << 8)
 
const int PREDICT_MASK = (3 << 8)
 
- Public Attributes inherited from OpenCVForUnity.MlModule.StatModel
const int UPDATE_MODEL = 1
 
const int RAW_OUTPUT = 1
 
const int COMPRESSED_INPUT = 2
 
const int PREPROCESSED_INPUT = 4
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.MlModule.StatModel
override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

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 also
ml_intro_trees

Member Function Documentation

◆ __fromPtr__()

static new DTrees OpenCVForUnity.MlModule.DTrees.__fromPtr__ ( IntPtr  addr)
static

◆ create()

static DTrees OpenCVForUnity.MlModule.DTrees.create ( )
static

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).

◆ Dispose()

override void OpenCVForUnity.MlModule.DTrees.Dispose ( bool  disposing)
protectedvirtual

◆ getCVFolds()

int OpenCVForUnity.MlModule.DTrees.getCVFolds ( )
See also
setCVFolds

◆ getMaxCategories()

int OpenCVForUnity.MlModule.DTrees.getMaxCategories ( )

◆ getMaxDepth()

int OpenCVForUnity.MlModule.DTrees.getMaxDepth ( )
See also
setMaxDepth

◆ getMinSampleCount()

int OpenCVForUnity.MlModule.DTrees.getMinSampleCount ( )

◆ getPriors()

Mat OpenCVForUnity.MlModule.DTrees.getPriors ( )
See also
setPriors

◆ getRegressionAccuracy()

float OpenCVForUnity.MlModule.DTrees.getRegressionAccuracy ( )

◆ getTruncatePrunedTree()

bool OpenCVForUnity.MlModule.DTrees.getTruncatePrunedTree ( )

◆ getUse1SERule()

bool OpenCVForUnity.MlModule.DTrees.getUse1SERule ( )
See also
setUse1SERule

◆ getUseSurrogates()

bool OpenCVForUnity.MlModule.DTrees.getUseSurrogates ( )

◆ load() [1/2]

static DTrees OpenCVForUnity.MlModule.DTrees.load ( string  filepath,
string  nodeName 
)
static

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
filepathpath to serialized DTree
nodeNamename of node containing the classifier

◆ load() [2/2]

static DTrees OpenCVForUnity.MlModule.DTrees.load ( string  filepath)
static

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
filepathpath to serialized DTree
nodeNamename of node containing the classifier

◆ setCVFolds()

void OpenCVForUnity.MlModule.DTrees.setCVFolds ( int  val)
See also
getCVFolds

◆ setMaxCategories()

void OpenCVForUnity.MlModule.DTrees.setMaxCategories ( int  val)

◆ setMaxDepth()

void OpenCVForUnity.MlModule.DTrees.setMaxDepth ( int  val)
See also
getMaxDepth

◆ setMinSampleCount()

void OpenCVForUnity.MlModule.DTrees.setMinSampleCount ( int  val)

◆ setPriors()

void OpenCVForUnity.MlModule.DTrees.setPriors ( Mat  val)
See also
getPriors

◆ setRegressionAccuracy()

void OpenCVForUnity.MlModule.DTrees.setRegressionAccuracy ( float  val)

◆ setTruncatePrunedTree()

void OpenCVForUnity.MlModule.DTrees.setTruncatePrunedTree ( bool  val)

◆ setUse1SERule()

void OpenCVForUnity.MlModule.DTrees.setUse1SERule ( bool  val)
See also
getUse1SERule

◆ setUseSurrogates()

void OpenCVForUnity.MlModule.DTrees.setUseSurrogates ( bool  val)

Member Data Documentation

◆ PREDICT_AUTO

const int OpenCVForUnity.MlModule.DTrees.PREDICT_AUTO = 0

◆ PREDICT_MASK

const int OpenCVForUnity.MlModule.DTrees.PREDICT_MASK = (3 << 8)

◆ PREDICT_MAX_VOTE

const int OpenCVForUnity.MlModule.DTrees.PREDICT_MAX_VOTE = (2 << 8)

◆ PREDICT_SUM

const int OpenCVForUnity.MlModule.DTrees.PREDICT_SUM = (1 << 8)

The documentation for this class was generated from the following file: