MCPcopy Create free account
hub / github.com/PythonOT/POT / test_fda

Function test_fda

test/test_dr.py:22–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20
21@pytest.mark.skipif(nogo, reason="Missing modules (autograd or pymanopt)")
22def test_fda():
23 n_samples = 90 # nb samples in source and target datasets
24 rng = np.random.RandomState(0)
25
26 # generate gaussian dataset
27 xs, ys = ot.datasets.make_data_classif("gaussrot", n_samples, random_state=rng)
28
29 n_features_noise = 8
30
31 xs = np.hstack((xs, rng.randn(n_samples, n_features_noise)))
32
33 p = 1
34
35 Pfda, projfda = ot.dr.fda(xs, ys, p)
36
37 projfda(xs)
38
39 np.testing.assert_allclose(np.sum(Pfda**2, 0), np.ones(p))
40
41
42@pytest.mark.skipif(nogo, reason="Missing modules (autograd or pymanopt)")

Callers

nothing calls this directly

Calls 3

randnMethod · 0.45
sumMethod · 0.45
onesMethod · 0.45

Tested by

no test coverage detected