Skip to content

Commit a8d7301

Browse files
committed
add test plot and dataset
1 parent 5aad08a commit a8d7301

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

test/test_dr.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,17 @@
1212
@pytest.mark.skipif(nogo, reason="Missing modules (autograd or pymanopt)")
1313
def test_fda():
1414

15-
n = 100 # nb samples in source and target datasets
16-
nz = 0.2
15+
n = 90 # nb samples in source and target datasets
1716
np.random.seed(0)
1817

1918
# generate circle dataset
20-
t = np.random.rand(n) * 2 * np.pi
21-
ys = np.floor((np.arange(n) * 1.0 / n * 3)) + 1
22-
xs = np.concatenate(
23-
(np.cos(t).reshape((-1, 1)), np.sin(t).reshape((-1, 1))), 1)
24-
xs = xs * ys.reshape(-1, 1) + nz * np.random.randn(n, 2)
19+
xs, ys = ot.datasets.get_data_classif('gaussrot', n)
2520

2621
nbnoise = 8
2722

2823
xs = np.hstack((xs, np.random.randn(n, nbnoise)))
2924

30-
p = 2
25+
p = 1
3126

3227
Pfda, projfda = ot.dr.fda(xs, ys, p)
3328

0 commit comments

Comments
 (0)