Struct tangram_tree::TrainOptions[][src]

pub struct TrainOptions {
Show fields pub binned_features_layout: BinnedFeaturesLayout, pub compute_losses: bool, pub early_stopping_options: Option<EarlyStoppingOptions>, pub l2_regularization_for_continuous_splits: f32, pub l2_regularization_for_discrete_splits: f32, pub learning_rate: f32, pub max_depth: Option<usize>, pub max_examples_for_computing_bin_thresholds: usize, pub max_leaf_nodes: usize, pub max_rounds: usize, pub max_valid_bins_for_number_features: u8, pub min_examples_per_node: usize, pub min_gain_to_split: f32, pub min_sum_hessians_per_node: f32, pub smoothing_factor_for_discrete_bin_sorting: f32,
}
Expand description

These are the options passed to Regressor::train, BinaryClassifier::train, and MulticlassClassifier::train.

Fields

binned_features_layout: BinnedFeaturesLayout

This option controls whether binned features will be laid out in row major or column major order. Each will produce the same result, but row major will be faster for datasets with more rows and fewer columns, while column major will be faster for datasets with fewer rows and more columns.

compute_losses: bool

If true, the model will include the loss on the training data after each round.

early_stopping_options: Option<EarlyStoppingOptions>

This option controls early stopping. If it is Some, then early stopping will be enabled. If it is None, then early stopping will be disabled.

l2_regularization_for_continuous_splits: f32

This option sets the L2 regularization value for continuous splits, which helps avoid overfitting.

l2_regularization_for_discrete_splits: f32

This option sets the L2 regularization value for discrete splits, which helps avoid overfitting.

learning_rate: f32

The learning rate scales the leaf values to control the effect each tree has on the output.

max_depth: Option<usize>

This is the maximum depth of a single tree. If this value is None, the depth will not be limited.

max_examples_for_computing_bin_thresholds: usize

This is the maximum number of examples to consider when determining the bin thresholds for number features.

max_leaf_nodes: usize

This is the maximum number of leaf nodes in a single tree.

max_rounds: usize

This is the maximum number of rounds of training that will occur. Fewer rounds may be trained if early stopping is enabled.

max_valid_bins_for_number_features: u8

When computing the bin thresholds for number features, this is the maximum number of bins for valid values to create. If the number of unique values in the number feature is less than this value, the thresholds will be equal to the unique values, which can improve accuracy when number features have a small set of possible values.

min_examples_per_node: usize

A split will only be considered valid if the number of training examples sent to each of the resulting children is at least this value.

min_gain_to_split: f32

A node will only be split if the best split achieves at least this minimum gain.

min_sum_hessians_per_node: f32

A split will only be considered valid if the sum of hessians in each of the resulting children is at least this value.

smoothing_factor_for_discrete_bin_sorting: f32

When choosing which direction each enum variant should be sent in a discrete split, the enum variants are sorted by a score computed from the sum of gradients and hessians for examples with that enum variant. This smoothing factor is added to the denominator of that score.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Converts self into a target type. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Performs the conversion.

Performs the conversion.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into T using TryInto<T>. Read more

Attempts to convert self into a target type. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.