@@ -55,6 +55,17 @@ def test_iris(self):
5555 csep = class_separation (lsml .transform (), self .iris_labels )
5656 self .assertLess (csep , 0.8 ) # it's pretty terrible
5757
58+ def test_deprecation (self ):
59+ # test that the right deprecation message is thrown.
60+ # TODO: remove in v.0.5
61+ X = np .array ([[0 , 0 ], [0 , 1 ], [2 , 0 ], [2 , 1 ]])
62+ y = np .array ([1 , 0 , 1 , 0 ])
63+ lsml_supervised = LSML_Supervised (num_labeled = np .inf )
64+ msg = ('"num_labeled" parameter is not used.'
65+ ' It has been deprecated in version 0.4 and will be'
66+ 'removed in 0.5' )
67+ assert_warns_message (DeprecationWarning , msg , lsml_supervised .fit , X , y )
68+
5869
5970class TestITML (MetricTestCase ):
6071 def test_iris (self ):
@@ -64,6 +75,17 @@ def test_iris(self):
6475 csep = class_separation (itml .transform (), self .iris_labels )
6576 self .assertLess (csep , 0.2 )
6677
78+ def test_deprecation (self ):
79+ # test that the right deprecation message is thrown.
80+ # TODO: remove in v.0.5
81+ X = np .array ([[0 , 0 ], [0 , 1 ], [2 , 0 ], [2 , 1 ]])
82+ y = np .array ([1 , 0 , 1 , 0 ])
83+ itml_supervised = ITML_Supervised (num_labeled = np .inf )
84+ msg = ('"num_labeled" parameter is not used.'
85+ ' It has been deprecated in version 0.4 and will be'
86+ 'removed in 0.5' )
87+ assert_warns_message (DeprecationWarning , msg , itml_supervised .fit , X , y )
88+
6789
6890class TestLMNN (MetricTestCase ):
6991 def test_iris (self ):
@@ -118,6 +140,17 @@ def test_iris(self):
118140 csep = class_separation (sdml .transform (), self .iris_labels )
119141 self .assertLess (csep , 0.25 )
120142
143+ def test_deprecation (self ):
144+ # test that the right deprecation message is thrown.
145+ # TODO: remove in v.0.5
146+ X = np .array ([[0 , 0 ], [0 , 1 ], [2 , 0 ], [2 , 1 ]])
147+ y = np .array ([1 , 0 , 1 , 0 ])
148+ sdml_supervised = SDML_Supervised (num_labeled = np .inf )
149+ msg = ('"num_labeled" parameter is not used.'
150+ ' It has been deprecated in version 0.4 and will be'
151+ 'removed in 0.5' )
152+ assert_warns_message (DeprecationWarning , msg , sdml_supervised .fit , X , y )
153+
121154
122155class TestNCA (MetricTestCase ):
123156 def test_iris (self ):
@@ -343,6 +376,17 @@ def test_iris(self):
343376 csep = class_separation (mmc .transform (), self .iris_labels )
344377 self .assertLess (csep , 0.2 )
345378
379+ def test_deprecation (self ):
380+ # test that the right deprecation message is thrown.
381+ # TODO: remove in v.0.5
382+ X = np .array ([[0 , 0 ], [0 , 1 ], [2 , 0 ], [2 , 1 ]])
383+ y = np .array ([1 , 0 , 1 , 0 ])
384+ mmc_supervised = MMC_Supervised (num_labeled = np .inf )
385+ msg = ('"num_labeled" parameter is not used.'
386+ ' It has been deprecated in version 0.4 and will be'
387+ 'removed in 0.5' )
388+ assert_warns_message (DeprecationWarning , msg , mmc_supervised .fit , X , y )
389+
346390
347391@pytest .mark .parametrize (('algo_class' , 'dataset' ),
348392 [(NCA , make_classification ()),
0 commit comments