def process_itml(self, **option): '''Metric Learning algorithm: ITML''' GeneExp = self.GeneExp_train Label = self.Label_train itml = ITML_Supervised(**option) itml.fit(GeneExp, Label) self.Trans['ITML'] = itml.transformer()
def test_itml_supervised(self): seed = np.random.RandomState(1234) itml = ITML_Supervised(num_constraints=200) itml.fit(self.X, self.y, random_state=seed) L = itml.transformer() assert_array_almost_equal(L.T.dot(L), itml.metric())