summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2017-07-24 16:39:19 +0200
committerRémi Flamary <remi.flamary@gmail.com>2017-07-24 16:39:19 +0200
commita8d7301c132a225b5e4d78cae64683a5e08eae7f (patch)
tree6782b3b4369bcbe0c652a918ee153e996ebc528e /test
parent5aad08aff3e1a171ef9263af4488d175139085a0 (diff)
add test plot and dataset
Diffstat (limited to 'test')
-rw-r--r--test/test_dr.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/test/test_dr.py b/test/test_dr.py
index 24ccaa1..3da7705 100644
--- a/test/test_dr.py
+++ b/test/test_dr.py
@@ -12,22 +12,17 @@ except ImportError:
@pytest.mark.skipif(nogo, reason="Missing modules (autograd or pymanopt)")
def test_fda():
- n = 100 # nb samples in source and target datasets
- nz = 0.2
+ n = 90 # nb samples in source and target datasets
np.random.seed(0)
# generate circle dataset
- t = np.random.rand(n) * 2 * np.pi
- ys = np.floor((np.arange(n) * 1.0 / n * 3)) + 1
- xs = np.concatenate(
- (np.cos(t).reshape((-1, 1)), np.sin(t).reshape((-1, 1))), 1)
- xs = xs * ys.reshape(-1, 1) + nz * np.random.randn(n, 2)
+ xs, ys = ot.datasets.get_data_classif('gaussrot', n)
nbnoise = 8
xs = np.hstack((xs, np.random.randn(n, nbnoise)))
- p = 2
+ p = 1
Pfda, projfda = ot.dr.fda(xs, ys, p)