def test_mmc(self): def_kwargs = { 'convergence_threshold': 0.001, 'diagonal': False, 'diagonal_c': 1.0, 'init': 'identity', 'max_iter': 100, 'max_proj': 10000, 'preprocessor': None, 'random_state': None, 'verbose': False } nndef_kwargs = {'diagonal': True} merged_kwargs = sk_repr_kwargs(def_kwargs, nndef_kwargs) self.assertEqual(remove_spaces(str(metric_learn.MMC(diagonal=True))), remove_spaces(f"MMC({merged_kwargs})")) def_kwargs = { 'convergence_threshold': 1e-06, 'diagonal': False, 'diagonal_c': 1.0, 'init': 'identity', 'max_iter': 100, 'max_proj': 10000, 'num_constraints': None, 'preprocessor': None, 'random_state': None, 'verbose': False } nndef_kwargs = {'max_iter': 1} merged_kwargs = sk_repr_kwargs(def_kwargs, nndef_kwargs) self.assertEqual( remove_spaces(str(metric_learn.MMC_Supervised(max_iter=1))), remove_spaces(f"MMC_Supervised({merged_kwargs})"))
def test_mmc(self): self.assertEqual(str(metric_learn.MMC()), """ MMC(A0=None, convergence_threshold=0.001, diagonal=False, diagonal_c=1.0, max_iter=100, max_proj=10000, preprocessor=None, verbose=False) """.strip('\n')) self.assertEqual(str(metric_learn.MMC_Supervised()), """ MMC_Supervised(A0=None, convergence_threshold=1e-06, diagonal=False, diagonal_c=1.0, max_iter=100, max_proj=10000, num_constraints=None, num_labeled='deprecated', preprocessor=None, verbose=False) """.strip('\n'))
def test_mmc(self): self.assertEqual( remove_spaces(str(metric_learn.MMC())), remove_spaces(""" MMC(A0='deprecated', convergence_threshold=0.001, diagonal=False, diagonal_c=1.0, init=None, max_iter=100, max_proj=10000, preprocessor=None, random_state=None, verbose=False) """)) self.assertEqual( remove_spaces(str(metric_learn.MMC_Supervised())), remove_spaces(""" MMC_Supervised(A0='deprecated', convergence_threshold=1e-06, diagonal=False, diagonal_c=1.0, init=None, max_iter=100, max_proj=10000, num_constraints=None, num_labeled='deprecated', preprocessor=None, random_state=None, verbose=False) """))
def test_mmc(self): self.assertEqual(remove_spaces(str(metric_learn.MMC(diagonal=True))), remove_spaces("MMC(diagonal=True)")) self.assertEqual( remove_spaces(str(metric_learn.MMC_Supervised(max_iter=1))), remove_spaces("MMC_Supervised(max_iter=1)"))