fn best_split_with_scratch(
samples: &[(TreeSample, f64)],
min_samples_leaf: usize,
sse: f64,
min_rel_var_reduction: f64,
scratch: &mut Vec<(TreeSample, f64)>,
) -> Option<(u8, u64)>Expand description
Variant of best_split that reuses a caller-provided buffer for sorting. The buffer is cleared and filled from samples for each feature, so the per-feature allocation is avoided after the first call.