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

Function test_wda

test/test_dr.py:43–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41
42@pytest.mark.skipif(nogo, reason="Missing modules (autograd or pymanopt)")
43def test_wda():
44 n_samples = 100 # nb samples in source and target datasets
45 rng = np.random.RandomState(0)
46
47 # generate gaussian dataset
48 xs, ys = ot.datasets.make_data_classif("gaussrot", n_samples, random_state=rng)
49
50 n_features_noise = 8
51
52 xs = np.hstack((xs, rng.randn(n_samples, n_features_noise)))
53
54 p = 2
55
56 Pwda, projwda = ot.dr.wda(xs, ys, p, maxiter=10)
57
58 projwda(xs)
59
60 np.testing.assert_allclose(np.sum(Pwda**2, 0), np.ones(p))
61
62
63@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