Struct rustlearn::trees::decision_tree::Hyperparameters
[−]
[src]
pub struct Hyperparameters {
// some fields omitted
}Hyperparameters for a DecisionTree model.
Methods
impl Hyperparameters[src]
fn new(dim: usize) -> Hyperparameters
Creates new Hyperparameters
Examples
use rustlearn::trees::decision_tree::Hyperparameters; let model = Hyperparameters::new(4) .min_samples_split(5) .max_depth(40) .build();
fn max_features(&mut self, max_features: usize) -> &mut Hyperparameters
Set the maximum number of features to be considered when finding the best split for the decision tree.
Defaults to sqrt(self.dim)
fn min_samples_split(&mut self, min_samples_split: usize) -> &mut Hyperparameters
Set the minimum number of samples that must be present in order for further splitting to take place.
Defaults to 2.
fn max_depth(&mut self, max_depth: usize) -> &mut Hyperparameters
Set the maximum depth of the tree.
Defaults to usize::MAX.
fn rng(&mut self, rng: StdRng) -> &mut Hyperparameters
Set the random number generator used for sampling features to consider at each split.
fn build(&self) -> DecisionTree
Build a binary decision tree model.
fn one_vs_rest(&self) -> OneVsRestWrapper<DecisionTree>
Build a one-vs-rest multi-class decision tree model.
Trait Implementations
impl Decodable for Hyperparameters[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Hyperparameters, __D::Error>
impl Encodable for Hyperparameters[src]
impl Clone for Hyperparameters[src]
fn clone(&self) -> Hyperparameters
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more