pub fn stratified_split(
data: &Dataset,
test_ratio: f64,
seed: u64,
) -> (Dataset, Dataset)Expand description
Stratified train/test split — preserves class proportions.
Groups samples by target value and splits each group independently, ensuring the ratio of each class is maintained in both sets.