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

Function _dataset

python/tests/test_feature_diagnostics_module.py:6–19  ·  view source on GitHub ↗
(n: int = 220)

Source from the content-addressed store, hash-verified

4
5
6def _dataset(n: int = 220):
7 rng = random.Random(123)
8 x = []
9 y = []
10 event_end = []
11 for i in range(n):
12 f0 = rng.gauss(0.0, 1.0)
13 f1 = 0.96 * f0 + 0.04 * rng.gauss(0.0, 1.0)
14 f2 = rng.gauss(0.0, 1.0)
15 score = 0.9 * f0 + 0.2 * f2 + 0.2 * rng.gauss(0.0, 1.0)
16 x.append([f0, f1, f2])
17 y.append(1.0 if score > 0 else 0.0)
18 event_end.append(min(n - 1, i + (i % 5)))
19 return x, y, ["f0", "f1", "f2"], event_end
20
21
22def test_mda_default_cv_and_scoring_modes():

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected