Skip to main content

SplitCriterion

Trait SplitCriterion 

Source
pub trait SplitCriterion:
    Send
    + Sync
    + 'static {
    // Required method
    fn evaluate(
        &self,
        grad_sums: &[f64],
        hess_sums: &[f64],
        total_grad: f64,
        total_hess: f64,
        gamma: f64,
        lambda: f64,
    ) -> Option<SplitCandidate>;
}
Available on crate feature alloc only.
Expand description

Evaluates split quality from histogram gradient/hessian sums.

Required Methods§

Source

fn evaluate( &self, grad_sums: &[f64], hess_sums: &[f64], total_grad: f64, total_hess: f64, gamma: f64, lambda: f64, ) -> Option<SplitCandidate>

Evaluate all possible split points across histogram bins. Returns the best split candidate, or None if no valid split exists.

§Arguments
  • grad_sums - gradient sums per bin
  • hess_sums - hessian sums per bin
  • total_grad - total gradient across all bins
  • total_hess - total hessian across all bins
  • gamma - minimum split gain threshold
  • lambda - L2 regularization on leaf weights

Implementors§