pub struct LearnerConfig {
pub num_classes: u32,
pub regularization: Option<TreeRegularizationConfig>,
pub constraints: Option<TreeConstraintsConfig>,
pub pruning_mode: i32,
pub growing_mode: i32,
pub learning_rate_tuner: Option<LearningRateConfig>,
pub multi_class_strategy: i32,
pub averaging_config: Option<AveragingConfig>,
pub weak_learner_type: i32,
pub each_tree_start: Option<DecisionTreeConfig>,
pub each_tree_start_num_layers: i32,
pub feature_fraction: Option<FeatureFraction>,
}
Fields§
§num_classes: u32
Number of classes.
regularization: Option<TreeRegularizationConfig>
Regularization.
constraints: Option<TreeConstraintsConfig>
Constraints.
pruning_mode: i32
Pruning. POST_PRUNE is the default pruning mode.
growing_mode: i32
Growing Mode. LAYER_BY_LAYER is the default growing mode.
learning_rate_tuner: Option<LearningRateConfig>
Learning rate. By default we use fixed learning rate of 0.1.
multi_class_strategy: i32
Multi-class strategy. By default we use TREE_PER_CLASS for binary classification and linear regression. For other cases, we use DIAGONAL_HESSIAN as the default.
averaging_config: Option<AveragingConfig>
If you want to average the ensembles (for regularization), provide the config below.
weak_learner_type: i32
By default we use NORMAL_DECISION_TREE as weak learner.
each_tree_start: Option<DecisionTreeConfig>
If you want to enforce some splits and allow boosting to figure out the rest, you can provide a tree that represents the starting splits for each tree in the ensemble. Set both each_tree_start and each_tree_start_num_layers.
each_tree_start_num_layers: i32
§feature_fraction: Option<FeatureFraction>
Fraction of features to consider in each tree sampled randomly from all available features.
Implementations§
Source§impl LearnerConfig
impl LearnerConfig
Sourcepub fn pruning_mode(&self) -> PruningMode
pub fn pruning_mode(&self) -> PruningMode
Returns the enum value of pruning_mode
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_pruning_mode(&mut self, value: PruningMode)
pub fn set_pruning_mode(&mut self, value: PruningMode)
Sets pruning_mode
to the provided enum value.
Sourcepub fn growing_mode(&self) -> GrowingMode
pub fn growing_mode(&self) -> GrowingMode
Returns the enum value of growing_mode
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_growing_mode(&mut self, value: GrowingMode)
pub fn set_growing_mode(&mut self, value: GrowingMode)
Sets growing_mode
to the provided enum value.
Sourcepub fn multi_class_strategy(&self) -> MultiClassStrategy
pub fn multi_class_strategy(&self) -> MultiClassStrategy
Returns the enum value of multi_class_strategy
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_multi_class_strategy(&mut self, value: MultiClassStrategy)
pub fn set_multi_class_strategy(&mut self, value: MultiClassStrategy)
Sets multi_class_strategy
to the provided enum value.
Sourcepub fn weak_learner_type(&self) -> WeakLearnerType
pub fn weak_learner_type(&self) -> WeakLearnerType
Returns the enum value of weak_learner_type
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_weak_learner_type(&mut self, value: WeakLearnerType)
pub fn set_weak_learner_type(&mut self, value: WeakLearnerType)
Sets weak_learner_type
to the provided enum value.
Trait Implementations§
Source§impl Clone for LearnerConfig
impl Clone for LearnerConfig
Source§fn clone(&self) -> LearnerConfig
fn clone(&self) -> LearnerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for LearnerConfig
impl Debug for LearnerConfig
Source§impl Default for LearnerConfig
impl Default for LearnerConfig
Source§impl Message for LearnerConfig
impl Message for LearnerConfig
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.