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

Function test_bootstrap_loop_run

crates/openquant/tests/sampling.rs:153–174  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151 let uniq = get_ind_mat_label_uniqueness(&ind).unwrap();
152 let avg = get_ind_mat_average_uniqueness(&ind).unwrap();
153 assert!(
154 (uniq[0].iter().filter(|v| **v > 0.0).sum::<f64>()
155 / uniq[0].iter().filter(|v| **v > 0.0).count() as f64
156 - 0.8333)
157 .abs()
158 <= 1e-2
159 );
160 assert!(
161 (uniq[1].iter().filter(|v| **v > 0.0).sum::<f64>()
162 / uniq[1].iter().filter(|v| **v > 0.0).count() as f64
163 - 0.75)
164 .abs()
165 <= 1e-2
166 );
167 assert!(
168 (uniq[2].iter().filter(|v| **v > 0.0).sum::<f64>()
169 / uniq[2].iter().filter(|v| **v > 0.0).count() as f64
170 - 1.0)
171 .abs()
172 <= 1e-2
173 );
174 assert!((avg - 0.8571).abs() <= 1e-2);
175}
176
177#[test]

Callers

nothing calls this directly

Calls 2

bootstrap_loop_runFunction · 0.85
lenMethod · 0.80

Tested by

no test coverage detected