org.opencv.ml

## Class RTrees

- java.lang.Object
- - org.opencv.core.Algorithm
  - - org.opencv.ml.StatModel
    - - org.opencv.ml.DTrees
      - - org.opencv.ml.RTrees

-     public class RTrees
      extends DTrees

  The class implements the random forest predictor. SEE: REF: ml_intro_rtrees

- - ### Field Summary

    - ### Fields inherited from class org.opencv.ml.DTrees

      `PREDICT_AUTO, PREDICT_MASK, PREDICT_MAX_VOTE, PREDICT_SUM`

    - ### Fields inherited from class org.opencv.ml.StatModel

      `COMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL`

    - ### Fields inherited from class org.opencv.core.Algorithm

      `nativeObj`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `RTrees(long addr)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static RTrees` | `__fromPtr__(long addr)`
    `static RTrees` | `create()` Creates the empty model.
    `protected void` | `finalize()`
    `int` | `getActiveVarCount()` SEE: setActiveVarCount
    `boolean` | `getCalculateVarImportance()` SEE: setCalculateVarImportance
    `TermCriteria` | `getTermCriteria()` SEE: setTermCriteria
    `Mat` | `getVarImportance()` Returns the variable importance array.
    `void` | `getVotes(Mat samples, Mat results, int flags)` Returns the result of each individual tree in the forest.
    `static RTrees` | `load(String filepath)` Loads and creates a serialized RTree from a file Use RTree::save to serialize and store an RTree to disk.
    `static RTrees` | `load(String filepath, String nodeName)` Loads and creates a serialized RTree from a file Use RTree::save to serialize and store an RTree to disk.
    `void` | `setActiveVarCount(int val)` getActiveVarCount SEE: getActiveVarCount
    `void` | `setCalculateVarImportance(boolean val)` getCalculateVarImportance SEE: getCalculateVarImportance
    `void` | `setTermCriteria(TermCriteria val)` getTermCriteria SEE: getTermCriteria

    - ### Methods inherited from class org.opencv.ml.DTrees

      `getCVFolds, getMaxCategories, getMaxDepth, getMinSampleCount, getPriors, getRegressionAccuracy, getTruncatePrunedTree, getUse1SERule, getUseSurrogates, setCVFolds, setMaxCategories, setMaxDepth, setMinSampleCount, setPriors, setRegressionAccuracy, setTruncatePrunedTree, setUse1SERule, setUseSurrogates`

    - ### Methods 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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RTrees

          protected RTrees(long addr)

  - ### Method Detail

    - #### __fromPtr__

          public static RTrees __fromPtr__(long addr)

    - #### getVarImportance

          public Mat getVarImportance()

      Returns the variable importance array. The method returns the variable importance vector, computed at the training stage when CalculateVarImportance is set to true. If this flag was set to false, the empty matrix is returned.
      Returns:
        automatically generated

    - #### create

          public static RTrees create()

      Creates the empty model. Use StatModel::train to train the model, StatModel::train to create and train the model, Algorithm::load to load the pre-trained model.
      Returns:
        automatically generated

    - #### load

          public static RTrees load(String filepath,
                                    String nodeName)

      Loads and creates a serialized RTree from a file Use RTree::save to serialize and store an RTree to disk. Load the RTree 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 RTree
        `nodeName` - name of node containing the classifier
      Returns:
        automatically generated

    - #### load

          public static RTrees load(String filepath)

      Loads and creates a serialized RTree from a file Use RTree::save to serialize and store an RTree to disk. Load the RTree 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 RTree
      Returns:
        automatically generated

    - #### getTermCriteria

          public TermCriteria getTermCriteria()

      SEE: setTermCriteria
      Returns:
        automatically generated

    - #### getCalculateVarImportance

          public boolean getCalculateVarImportance()

      SEE: setCalculateVarImportance
      Returns:
        automatically generated

    - #### getActiveVarCount

          public int getActiveVarCount()

      SEE: setActiveVarCount
      Returns:
        automatically generated

    - #### getVotes

          public void getVotes(Mat samples,
                               Mat results,
                               int flags)

      Returns the result of each individual tree in the forest. In case the model is a regression problem, the method will return each of the trees' results for each of the sample cases. If the model is a classifier, it will return a Mat with samples + 1 rows, where the first row gives the class number and the following rows return the votes each class had for each sample.
      Parameters:
        `samples` - Array containing the samples for which votes will be calculated.
        `results` - Array where the result of the calculation will be written.
        `flags` - Flags for defining the type of RTrees.

    - #### setActiveVarCount

          public void setActiveVarCount(int val)

      getActiveVarCount SEE: getActiveVarCount
      Parameters:
        `val` - automatically generated

    - #### setCalculateVarImportance

          public void setCalculateVarImportance(boolean val)

      getCalculateVarImportance SEE: getCalculateVarImportance
      Parameters:
        `val` - automatically generated

    - #### setTermCriteria

          public void setTermCriteria(TermCriteria val)

      getTermCriteria SEE: getTermCriteria
      Parameters:
        `val` - automatically generated

    - #### finalize

          protected void finalize()
                           throws Throwable

      Overrides:
        `finalize` in class `DTrees`
      Throws:
        `Throwable`

Generated on Thu Jul 25 2019 21:39:44 UTC / OpenCV 3.4.7