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

Function test_purged_kfold_basic

crates/openquant/tests/cross_validation.rs:51–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49
50#[test]
51fn test_purged_kfold_basic() {
52 let info_sets = make_series("2019-01-01 00:00:00", 20, 1);
53 let pkf = PurgedKFold::new(3, info_sets.clone(), 0.0).unwrap();
54 let splits = pkf.split(info_sets.len()).unwrap();
55 assert_eq!(splits.len(), 3);
56 for (train, test) in splits {
57 assert!(!train.is_empty());
58 assert!(!test.is_empty());
59 // ensure disjoint
60 for t in &test {
61 assert!(!train.contains(t));
62 }
63 }
64}
65
66#[test]
67fn test_purged_kfold_embargo() {

Callers

nothing calls this directly

Calls 3

splitMethod · 0.80
lenMethod · 0.80
make_seriesFunction · 0.70

Tested by

no test coverage detected