130cbadff294b686e466d430f26b2d069f6bbf59,metric_learn/sdml.py,_BaseSDML,_fit,#_BaseSDML#Any#Any#,65
Before Change
// set up (the inverse of) the prior M
if self.use_cov:
X = np.vstack({tuple(row) for row in pairs.reshape(-1, pairs.shape[2])})
prior_inv = np.atleast_2d(np.cov(X, rowvar=False))
else:
prior_inv = np.identity(pairs.shape[2])
diff = pairs[:, 0] - pairs[:, 1]
loss_matrix = (diff.T * y).dot(diff)
After Change
// set up (the inverse of) the prior M
// if the prior is the default (identity), we raise a warning just in case
if self.prior is None:
// TODO:
// replace prior=None by prior="identity" in v0.6.0 and remove the
// warning
msg = ("Warning, no prior was set (`prior=None`). As of version 0.5.0, "
"the default prior will now be set to "
""identity", instead of "covariance". If you still want to use "
"the inverse of the covariance matrix as a prior, "
"set prior="covariance". This warning will disappear in "
"v0.6.0, and `prior` parameter"s default value will be set to "
""identity".")
warnings.warn(msg, ChangedBehaviorWarning)
prior = "identity"
else:
prior = self.prior
_, prior_inv = _initialize_metric_mahalanobis(pairs, prior,
return_inverse=True,
strict_pd=True,
matrix_name="prior")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: metric-learn/metric-learn
Commit Name: 130cbadff294b686e466d430f26b2d069f6bbf59
Time: 2019-06-07
Author: 31916524+wdevazelhes@users.noreply.github.com
File Name: metric_learn/sdml.py
Class Name: _BaseSDML
Method Name: _fit
Project Name: scipy/scipy
Commit Name: 0131d72f0f7a5c13f00961aea054094b2b78f071
Time: 2016-10-12
Author: evgeny.burovskiy@gmail.com
File Name: scipy/interpolate/fitpack.py
Class Name:
Method Name: splev
Project Name: scipy/scipy
Commit Name: 0131d72f0f7a5c13f00961aea054094b2b78f071
Time: 2016-10-12
Author: evgeny.burovskiy@gmail.com
File Name: scipy/interpolate/fitpack.py
Class Name:
Method Name: splint