d916a4d9347a71901eee083ee023d03daf29ad07,moabb/contexts/evaluations.py,CrossSubjectEvaluation,score,#CrossSubjectEvaluation#Any#Any#Any#Any#Any#,93

Before Change


        
    def score(self, clf, X, y, groups, scoring):
        y_uniq = np.unique(y)
        if len(y_uniq) == 2:
            for ind, l in enumerate(y_uniq):
                y[y==l] = ind
        acc = cross_val_score(clf, X, y, cv=[(np.nonzero(groups==1)[0], np.nonzero(groups==0)[0])],
                              scoring=scoring, n_jobs=self.n_jobs)
        return acc.mean()

After Change


            self.ind_cache.append(np.ones(y.shape))
        
    def score(self, clf, X, y, groups, scoring):
        le = LabelEncoder()
        y = le.fit_transform(y)
        acc = cross_val_score(clf, X, y, cv=[(np.nonzero(groups==1)[0], np.nonzero(groups==0)[0])],
                              scoring=scoring, n_jobs=self.n_jobs)
        return acc.mean()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: NeuroTechX/moabb
Commit Name: d916a4d9347a71901eee083ee023d03daf29ad07
Time: 2018-02-19
Author: vjayaram@danube.is.localnet
File Name: moabb/contexts/evaluations.py
Class Name: CrossSubjectEvaluation
Method Name: score


Project Name: NeuroTechX/moabb
Commit Name: d916a4d9347a71901eee083ee023d03daf29ad07
Time: 2018-02-19
Author: vjayaram@danube.is.localnet
File Name: moabb/contexts/evaluations.py
Class Name: CrossSessionEvaluation
Method Name: score


Project Name: NeuroTechX/moabb
Commit Name: d916a4d9347a71901eee083ee023d03daf29ad07
Time: 2018-02-19
Author: vjayaram@danube.is.localnet
File Name: moabb/contexts/evaluations.py
Class Name: TrainTestEvaluation
Method Name: score