Struct forust_ml::splitter::MissingImputerSplitter
source · pub struct MissingImputerSplitter {
pub l2: f32,
pub gamma: f32,
pub min_leaf_weight: f32,
pub learning_rate: f32,
pub allow_missing_splits: bool,
pub constraints_map: ConstraintMap,
}Expand description
Missing imputer splitter Splitter that imputes missing values, by sending them down either the right or left branch, depending on which results in a higher increase in gain.
Fields§
§l2: f32§gamma: f32§min_leaf_weight: f32§learning_rate: f32§allow_missing_splits: bool§constraints_map: ConstraintMapImplementations§
Trait Implementations§
source§impl Splitter for MissingImputerSplitter
impl Splitter for MissingImputerSplitter
source§fn evaluate_split(
&self,
left_gradient: f32,
left_hessian: f32,
right_gradient: f32,
right_hessian: f32,
missing_gradient: f32,
missing_hessian: f32,
lower_bound: f32,
upper_bound: f32,
constraint: Option<&Constraint>
) -> Option<(NodeInfo, NodeInfo, MissingInfo)>
fn evaluate_split( &self, left_gradient: f32, left_hessian: f32, right_gradient: f32, right_hessian: f32, missing_gradient: f32, missing_hessian: f32, lower_bound: f32, upper_bound: f32, constraint: Option<&Constraint> ) -> Option<(NodeInfo, NodeInfo, MissingInfo)>
Evaluate a split, returning the node info for the left, and right splits,
as well as the node info the missing data of a feature.
source§fn handle_split_info(
&self,
split_info: SplitInfo,
n_nodes: &usize,
node: &mut SplittableNode,
index: &mut [usize],
data: &Matrix<'_, u16>,
cuts: &JaggedMatrix<f64>,
grad: &[f32],
hess: &[f32],
parallel: bool
) -> Vec<SplittableNode>
fn handle_split_info( &self, split_info: SplitInfo, n_nodes: &usize, node: &mut SplittableNode, index: &mut [usize], data: &Matrix<'_, u16>, cuts: &JaggedMatrix<f64>, grad: &[f32], hess: &[f32], parallel: bool ) -> Vec<SplittableNode>
Handle the split info, creating the children nodes, this function
will return a vector of new splitable nodes, that can be added to the
growable stack, and further split, or converted to leaf nodes.
fn get_constraint(&self, feature: &usize) -> Option<&Constraint>
fn get_gamma(&self) -> f32
fn get_l2(&self) -> f32
source§fn best_split(&self, node: &SplittableNode) -> Option<SplitInfo>
fn best_split(&self, node: &SplittableNode) -> Option<SplitInfo>
Find the best possible split, considering all feature histograms.
If we wanted to add Column sampling, this is probably where
we would need to do it, otherwise, it would be at the tree level.
fn best_feature_split( &self, node: &SplittableNode, feature: usize ) -> Option<SplitInfo>
source§fn split_node(
&self,
n_nodes: &usize,
node: &mut SplittableNode,
index: &mut [usize],
data: &Matrix<'_, u16>,
cuts: &JaggedMatrix<f64>,
grad: &[f32],
hess: &[f32],
parallel: bool
) -> Vec<SplittableNode>
fn split_node( &self, n_nodes: &usize, node: &mut SplittableNode, index: &mut [usize], data: &Matrix<'_, u16>, cuts: &JaggedMatrix<f64>, grad: &[f32], hess: &[f32], parallel: bool ) -> Vec<SplittableNode>
Split the node, if we cant find a best split, we will need to
return an empty vector, this node is a leaf.
Auto Trait Implementations§
impl RefUnwindSafe for MissingImputerSplitter
impl Send for MissingImputerSplitter
impl Sync for MissingImputerSplitter
impl Unpin for MissingImputerSplitter
impl UnwindSafe for MissingImputerSplitter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more