e7392399dfa3d64a87eb31dfdfc532ada310ea59,metric_learn/_util.py,,_initialize_metric_mahalanobis,#Any#Any#Any#Any#Any#Any#,597

Before Change


                        "require the {} to be strictly positive definite."
                        .format(*((matrix_name,) * 3)))
    if return_inverse:
      M_inv = np.dot(u / s, u.T)
      return M, M_inv
    else:
      return M

After Change


                        "require the `{}` to be strictly positive definite."
                        .format(*((matrix_name,) * 2)))
    elif not cov_is_definite:
      warnings.warn("The covariance matrix is not invertible: "
                    "using the pseudo-inverse instead."
                    "To make the covariance matrix invertible"
                    " you can remove any linearly dependent features and/or "
                    "reduce the dimensionality of your input, "
                    "for instance using `sklearn.decomposition.PCA` as a "
                    "preprocessing step.")
    M = _pseudo_inverse_from_eig(w, V)
    if return_inverse:
      return M, M_inv
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: metric-learn/metric-learn
Commit Name: e7392399dfa3d64a87eb31dfdfc532ada310ea59
Time: 2020-02-04
Author: gabriel.rudloff@gmail.com
File Name: metric_learn/_util.py
Class Name:
Method Name: _initialize_metric_mahalanobis


Project Name: nipy/dipy
Commit Name: 3b7e54a6e69be493f27b74f7e3840558c8a7f34b
Time: 2015-12-31
Author: girard.gabriel@gmail.com
File Name: dipy/tracking/utils.py
Class Name:
Method Name: random_seeds_from_mask


Project Name: metric-learn/metric-learn
Commit Name: 85185175f356697f4a91feacaed2d3a9d70af95f
Time: 2019-06-12
Author: 31916524+wdevazelhes@users.noreply.github.com
File Name: metric_learn/rca.py
Class Name: RCA
Method Name: fit