File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,11 @@ rdoc :
5656
5757notebook :
5858 ipython notebook --matplotlib=inline --notebook-dir=notebooks/
59+
60+ autopep8 :
61+ autopep8 -ir test ot examples
5962
63+ aautopep8 :
64+ autopep8 -air test ot examples
6065
6166FORCE :
Original file line number Diff line number Diff line change @@ -462,6 +462,30 @@ def test_linear_mapping():
462462 np .testing .assert_allclose (Ct , Cst , rtol = 1e-2 , atol = 1e-2 )
463463
464464
465+ def test_linear_mapping_class ():
466+
467+ ns = 150
468+ nt = 200
469+
470+ Xs , ys = get_data_classif ('3gauss' , ns )
471+ Xt , yt = get_data_classif ('3gauss2' , nt )
472+
473+ otmap = ot .da .LinearTransport ()
474+
475+ otmap .fit (Xs = Xs , Xt = Xt )
476+ assert hasattr (otmap , "A_" )
477+ assert hasattr (otmap , "B_" )
478+ assert hasattr (otmap , "A1_" )
479+ assert hasattr (otmap , "B1_" )
480+
481+ Xst = otmap .transform (Xs = Xs )
482+
483+ Ct = np .cov (Xt .T )
484+ Cst = np .cov (Xst .T )
485+
486+ np .testing .assert_allclose (Ct , Cst , rtol = 1e-2 , atol = 1e-2 )
487+
488+
465489def test_otda ():
466490
467491 n_samples = 150 # nb samples
You can’t perform that action at this time.
0 commit comments