(n_groups: usize, test_groups: usize)
| 473 | } |
| 474 | |
| 475 | fn validate_cpcv_params(n_groups: usize, test_groups: usize) -> Result<(), String> { |
| 476 | if n_groups < 2 { |
| 477 | return Err("n_groups must be >= 2".to_string()); |
| 478 | } |
| 479 | if test_groups == 0 { |
| 480 | return Err("test_groups must be > 0".to_string()); |
| 481 | } |
| 482 | if test_groups >= n_groups { |
| 483 | return Err("test_groups must be < n_groups".to_string()); |
| 484 | } |
| 485 | Ok(()) |
| 486 | } |
| 487 | |
| 488 | fn contiguous_folds(n_samples: usize, n_folds: usize) -> Result<Vec<Vec<usize>>, String> { |
| 489 | if n_folds == 0 { |
no outgoing calls
no test coverage detected