3e38fe09a87e6ef05289f3cbe6ffa03e2dc716e8,metric_learn/rca.py,RCA,fit,#RCA#Any#Any#,78

Before Change



    // PCA projection to remove noise and redundant information.
    M_pca = None
    if self.params["pca_comps"] is not None:
      pca = decomposition.PCA(n_components=self.params["pca_comps"],
                              svd_solver="full")
      data = pca.fit_transform(data)
      d = data.shape[1]
      M_pca = pca.components_
    else:
      data -= data.mean(axis=0)

    chunk_mask, chunk_data = self._process_chunks(data, chunks)
    inner_cov = np.cov(chunk_data, rowvar=0, bias=1)
    rank = np.linalg.matrix_rank(inner_cov)

After Change


    
    data, M_pca = self._process_data(data)

    chunks = np.asanyarray(chunks, dtype=int)
    chunk_mask, chunked_data = _chunk_mean_centering(data, chunks)

    inner_cov = np.cov(chunked_data, rowvar=0, bias=1)
    dim = self._check_dimension(np.linalg.matrix_rank(inner_cov))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: metric-learn/metric-learn
Commit Name: 3e38fe09a87e6ef05289f3cbe6ffa03e2dc716e8
Time: 2017-03-02
Author: perimosocordiae@gmail.com
File Name: metric_learn/rca.py
Class Name: RCA
Method Name: fit


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


Project Name: scikit-image/scikit-image
Commit Name: f893d1ff125b6b9990a20382aabcbe6ab15ea8f0
Time: 2018-02-04
Author: alvn.zng@gmail.com
File Name: skimage/io/_io.py
Class Name:
Method Name: imsave