@@ -177,7 +177,7 @@ class MahalanobisMixin(six.with_metaclass(ABCMeta, BaseMetricLearner,
177177
178178 Attributes
179179 ----------
180- transformer_ : `numpy.ndarray`, shape=(n_components, n_features)
180+ components_ : `numpy.ndarray`, shape=(n_components, n_features)
181181 The learned linear transformation ``L``.
182182 """
183183
@@ -243,10 +243,10 @@ def transform(self, X):
243243 X_checked = check_input (X , type_of_inputs = 'classic' , estimator = self ,
244244 preprocessor = self .preprocessor_ ,
245245 accept_sparse = True )
246- return X_checked .dot (self .transformer_ .T )
246+ return X_checked .dot (self .components_ .T )
247247
248248 def get_metric (self ):
249- transformer_T = self .transformer_ .T .copy ()
249+ components_T = self .components_ .T .copy ()
250250
251251 def metric_fun (u , v , squared = False ):
252252 """This function computes the metric between u and v, according to the
@@ -271,7 +271,7 @@ def metric_fun(u, v, squared=False):
271271 """
272272 u = validate_vector (u )
273273 v = validate_vector (v )
274- transformed_diff = (u - v ).dot (transformer_T )
274+ transformed_diff = (u - v ).dot (components_T )
275275 dist = np .dot (transformed_diff , transformed_diff .T )
276276 if not squared :
277277 dist = np .sqrt (dist )
@@ -298,7 +298,7 @@ def get_mahalanobis_matrix(self):
298298 M : `numpy.ndarray`, shape=(n_features, n_features)
299299 The copy of the learned Mahalanobis matrix.
300300 """
301- return self .transformer_ .T .dot (self .transformer_ )
301+ return self .components_ .T .dot (self .components_ )
302302
303303
304304class _PairsClassifierMixin (BaseMetricLearner ):
@@ -333,7 +333,7 @@ def predict(self, pairs):
333333 y_predicted : `numpy.ndarray` of floats, shape=(n_constraints,)
334334 The predicted learned metric value between samples in every pair.
335335 """
336- check_is_fitted (self , ['threshold_' , 'transformer_ ' ])
336+ check_is_fitted (self , ['threshold_' , 'components_ ' ])
337337 return 2 * (- self .decision_function (pairs ) <= self .threshold_ ) - 1
338338
339339 def decision_function (self , pairs ):
@@ -599,7 +599,7 @@ def predict(self, quadruplets):
599599 prediction : `numpy.ndarray` of floats, shape=(n_constraints,)
600600 Predictions of the ordering of pairs, for each quadruplet.
601601 """
602- check_is_fitted (self , 'transformer_ ' )
602+ check_is_fitted (self , 'components_ ' )
603603 quadruplets = check_input (quadruplets , type_of_inputs = 'tuples' ,
604604 preprocessor = self .preprocessor_ ,
605605 estimator = self , tuple_size = self ._tuple_size )
0 commit comments