fn choose_splits_with_highest_gain(
	children_best_splits_for_features: Vec<(
		Option<ChooseBestSplitForFeatureOutput>,
		Option<ChooseBestSplitForFeatureOutput>,
	)>,
) -> (
	Option<ChooseBestSplitForFeatureOutput>,
	Option<ChooseBestSplitForFeatureOutput>,
) {
	children_best_splits_for_features.into_iter().fold(
		(None, None),
		|(current_left, current_right), (candidate_left, candidate_right)| {
			(
				choose_split_with_highest_gain(current_left, candidate_left),
				choose_split_with_highest_gain(current_right, candidate_right),
			)
		},
	)
}
/// Choose the splits for the left and right children with the highest gain.
Choose the splits for the left and right children with the highest gain.
Choose the splits for the left and right children with the highest gain .
fn choose_splits_with_highest_gain(
	children_best_splits_for_features: Vec<(
		Option<ChooseBestSplitForFeatureOutput>,
		Option<ChooseBestSplitForFeatureOutput>,
	)>,
) -> (
	Option<ChooseBestSplitForFeatureOutput>,
	Option<ChooseBestSplitForFeatureOutput>,
) {
	children_best_splits_for_features.into_iter().fold(
		(None, None),
		|(current_left, current_right), (candidate_left, candidate_right)| {
			(
				choose_split_with_highest_gain(current_left, candidate_left),
				choose_split_with_highest_gain(current_right, candidate_right),
			)
		},
	)
}
fn choose_splits_with_highest_gain ( children_best_splits_for_features : Vec < ( Option < ChooseBestSplitForFeatureOutput > , Option < ChooseBestSplitForFeatureOutput > , ) > , ) -> ( Option < ChooseBestSplitForFeatureOutput > , Option < ChooseBestSplitForFeatureOutput > , ) { children_best_splits_for_features . into_iter ( ) . fold ( ( None , None ) , | ( current_left , current_right ) , ( candidate_left , candidate_right ) | { ( choose_split_with_highest_gain ( current_left , candidate_left ) , choose_split_with_highest_gain ( current_right , candidate_right ) , ) } , ) }
Choose the splits for the left and right children with the highest gain.
Choose the splits for the left and right children with the highest gain .
children_best_splits_for_features
Vec<(
		Option<ChooseBestSplitForFeatureOutput>,
		Option<ChooseBestSplitForFeatureOutput>,
	)>