|
25 | 25 |
|
26 | 26 | from .base_metric import _PairsClassifierMixin, MahalanobisMixin |
27 | 27 | from .constraints import Constraints, wrap_pairs |
28 | | -from ._util import vector_norm |
| 28 | +from ._util import vector_norm, transformer_from_metric |
29 | 29 |
|
30 | 30 |
|
31 | 31 | class _BaseMMC(MahalanobisMixin): |
@@ -206,7 +206,7 @@ def _fit_full(self, pairs, y): |
206 | 206 | self.A_[:] = A_old |
207 | 207 | self.n_iter_ = cycle |
208 | 208 |
|
209 | | - self.transformer_ = self.transformer_from_metric(self.A_) |
| 209 | + self.transformer_ = transformer_from_metric(self.A_) |
210 | 210 | return self |
211 | 211 |
|
212 | 212 | def _fit_diag(self, pairs, y): |
@@ -267,7 +267,7 @@ def _fit_diag(self, pairs, y): |
267 | 267 |
|
268 | 268 | self.A_ = np.diag(w) |
269 | 269 |
|
270 | | - self.transformer_ = self.transformer_from_metric(self.A_) |
| 270 | + self.transformer_ = transformer_from_metric(self.A_) |
271 | 271 | return self |
272 | 272 |
|
273 | 273 | def _fD(self, neg_pairs, A): |
@@ -355,7 +355,7 @@ class MMC(_BaseMMC, _PairsClassifierMixin): |
355 | 355 | ---------- |
356 | 356 | transformer_ : `numpy.ndarray`, shape=(num_dims, n_features) |
357 | 357 | The linear transformation ``L`` deduced from the learned Mahalanobis |
358 | | - metric (See :meth:`transformer_from_metric`.) |
| 358 | + metric (See function `transformer_from_metric`.) |
359 | 359 | """ |
360 | 360 |
|
361 | 361 | def fit(self, pairs, y): |
@@ -386,7 +386,7 @@ class MMC_Supervised(_BaseMMC, TransformerMixin): |
386 | 386 | ---------- |
387 | 387 | transformer_ : `numpy.ndarray`, shape=(num_dims, n_features) |
388 | 388 | The linear transformation ``L`` deduced from the learned Mahalanobis |
389 | | - metric (See :meth:`transformer_from_metric`.) |
| 389 | + metric (See function `transformer_from_metric`.) |
390 | 390 | """ |
391 | 391 |
|
392 | 392 | def __init__(self, max_iter=100, max_proj=10000, convergence_threshold=1e-6, |
|
0 commit comments