Trait opencv::prelude::RTreesTrait
source · pub trait RTreesTrait: DTreesTrait + RTreesTraitConst {
// Required method
fn as_raw_mut_RTrees(&mut self) -> *mut c_void;
// Provided methods
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<()> { ... }
}
Expand description
Mutable methods for crate::ml::RTrees
Required Methods§
fn as_raw_mut_RTrees(&mut self) -> *mut c_void
Provided Methods§
sourcefn 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
sourcefn 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
sourcefn 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