cbd5186bab98af9ea16d5fd7624978c92276b04c,metric_learn/mlkr.py,MLKR,_process_inputs,#MLKR#Any#Any#,34

Before Change


        if X.ndim == 1:
            X = X[:, np.newaxis]
        if y.ndim == 1:
            y = y[:, np.newaxis]
        n, d = X.shape
        if y.shape[0] != n:
            raise ValueError("Data and label lengths mismatch: %d != %d"

After Change


        m = self.params["num_dims"]
        if m is None:
            m = d
        if A is None:
            // initialize to PCA transformation matrix
            // note: not the same as n_components=m !
            A = PCA().fit(X).components_.T[:m]
        elif A.shape != (m, d):
            raise ValueError("A0 needs shape (%d,%d) but got %s" % (
                m, d, A.shape))
        return y, A

    def fit(self, X, y):
        
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: metric-learn/metric-learn
Commit Name: cbd5186bab98af9ea16d5fd7624978c92276b04c
Time: 2016-10-28
Author: perimosocordiae@gmail.com
File Name: metric_learn/mlkr.py
Class Name: MLKR
Method Name: _process_inputs


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: _process_data


Project Name: metric-learn/metric-learn
Commit Name: 23d07466961fa7a72aa8692bc42d6d569b80c5c9
Time: 2019-01-02
Author: 31916524+wdevazelhes@users.noreply.github.com
File Name: metric_learn/rca.py
Class Name: RCA
Method Name: fit