summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSlasnista <stan.chambon@gmail.com>2017-08-04 11:16:30 +0200
committerNicolas Courty <Nico@MacBook-Pro-de-Nicolas.local>2017-09-01 11:09:13 +0200
commitcd4fa7275dc65e04f7b256dec4208d68006abc25 (patch)
tree797beafc470be2bdae357018076dccd9c351f269 /test
parentd5c6cc178a731d955e5eb85e9f477805fa086518 (diff)
added test for fit_transform + correction of fit_transform bug (missing return self)
Diffstat (limited to 'test')
-rw-r--r--test/test_da.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/test_da.py b/test/test_da.py
index 33b3695..68807ec 100644
--- a/test/test_da.py
+++ b/test/test_da.py
@@ -58,6 +58,10 @@ def test_sinkhorn_transport_class():
# check that the oos method is not working and returns the input data
assert_equal(transp_Xt_new, Xt_new)
+ # test fit_transform
+ transp_Xs = clf.fit_transform(Xs=Xs, Xt=Xt)
+ assert_equal(transp_Xs.shape, Xs.shape)
+
def test_emd_transport_class():
"""test_sinkhorn_transport
@@ -104,6 +108,10 @@ def test_emd_transport_class():
# check that the oos method is not working and returns the input data
assert_equal(transp_Xt_new, Xt_new)
+ # test fit_transform
+ transp_Xs = clf.fit_transform(Xs=Xs, Xt=Xt)
+ assert_equal(transp_Xs.shape, Xs.shape)
+
def test_otda():
@@ -165,8 +173,3 @@ def test_otda():
da_emd = ot.da.OTDA_mapping_kernel() # init class
da_emd.fit(xs, xt, numItermax=10) # fit distributions
da_emd.predict(xs) # interpolation of source samples
-
-
-if __name__ == "__main__":
- test_sinkhorn_transport_class()
- test_emd_transport_class()