Trait opencv::hub_prelude::RTrees [−][src]
pub trait RTrees: DTrees + RTreesConst {
fn as_raw_mut_RTrees(&mut self) -> *mut c_void;
fn set_calculate_var_importance(&mut self, val: bool) -> Result<()> { ... }
fn set_active_var_count(&mut self, val: i32) -> Result<()> { ... }
fn set_term_criteria(&mut self, val: TermCriteria) -> Result<()> { ... }
}
Required methods
fn as_raw_mut_RTrees(&mut self) -> *mut c_void
Provided methods
fn set_calculate_var_importance(&mut self, val: bool) -> Result<()>
fn set_calculate_var_importance(&mut self, val: bool) -> Result<()>
If true then variable importance will be calculated and then it can be retrieved by RTrees::getVarImportance. Default value is false.
See also
setCalculateVarImportance getCalculateVarImportance
fn set_active_var_count(&mut self, val: i32) -> Result<()>
fn set_active_var_count(&mut self, val: i32) -> Result<()>
The size of the randomly selected subset of features at each tree node and that are used to find the best split(s). If you set it to 0 then the size will be set to the square root of the total number of features. Default value is 0.
See also
setActiveVarCount getActiveVarCount
fn set_term_criteria(&mut self, val: TermCriteria) -> Result<()>
fn set_term_criteria(&mut self, val: TermCriteria) -> Result<()>
The termination criteria that specifies when the training algorithm stops. Either when the specified number of trees is trained and added to the ensemble or when sufficient accuracy (measured as OOB error) is achieved. Typically the more trees you have the better the accuracy. However, the improvement in accuracy generally diminishes and asymptotes pass a certain number of trees. Also to keep in mind, the number of tree increases the prediction time linearly. Default value is TermCriteria(TermCriteria::MAX_ITERS + TermCriteria::EPS, 50, 0.1)
See also
setTermCriteria getTermCriteria
Implementations
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.
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
C++ default parameters
- node_name: String()