MCPcopy Create free account
hub / github.com/Open-Quant/openquant / validate_cpcv_params

Function validate_cpcv_params

crates/openquant/src/backtesting_engine.rs:475–486  ·  view source on GitHub ↗
(n_groups: usize, test_groups: usize)

Source from the content-addressed store, hash-verified

473}
474
475fn 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
488fn contiguous_folds(n_samples: usize, n_folds: usize) -> Result<Vec<Vec<usize>>, String> {
489 if n_folds == 0 {

Callers 2

cpcv_path_countFunction · 0.85
run_cpcvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected