summaryrefslogtreecommitdiff
path: root/test/test_da.py
diff options
context:
space:
mode:
authorSlasnista <stan.chambon@gmail.com>2017-08-04 11:16:30 +0200
committerSlasnista <stan.chambon@gmail.com>2017-08-04 11:16:30 +0200
commit70be03461db45de50ecd073b9795093ead1ba5f5 (patch)
tree797beafc470be2bdae357018076dccd9c351f269 /test/test_da.py
parentd9be6c2da1c0953de1720f1e93f194c71699c3cd (diff)
added test for fit_transform + correction of fit_transform bug (missing return self)
Diffstat (limited to 'test/test_da.py')
-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()