6ffdbc8963b6bcaf686af1a9d5b7ddf212dbfc31,tslearn/early_classification.py,NonMyopicEarlyClassification,fit,#NonMyopicEarlyClassification#Any#Any#,74

Before Change


        X = check_dims(X)
        y_classes = np.unique(y)
        self.labels_ = sorted(set(y_classes))
        y_classes_indices = [self.labels_.index(yi) for yi in y_classes]
        y_ = np.copy(y)
        for idx, current_class in enumerate(y_classes):
            y_[y_ == current_class] = y_classes_indices[idx]

        self.cluster_ = TimeSeriesKMeans(n_clusters=self.n_clusters,
                                         random_state=self.random_state)

After Change


        c_k = self.cluster_.fit_predict(X)
        X1, X2, c_k1, c_k2, y1, y2 = train_test_split(X, c_k, y, test_size=0.5)

        label_to_ind = {lab: ind for ind, lab in enumerate(label_set)}
        y_ = np.array([label_to_ind.get(lab, self.__n_classes_ + 1)
                       for lab in y])

        vector_of_ones = np.ones((X.shape[0], ))
        self.pyck_ = coo_matrix(
            (vector_of_ones, (y_, c_k)),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: rtavenar/tslearn
Commit Name: 6ffdbc8963b6bcaf686af1a9d5b7ddf212dbfc31
Time: 2020-04-21
Author: romain.tavenard@univ-rennes2.fr
File Name: tslearn/early_classification.py
Class Name: NonMyopicEarlyClassification
Method Name: fit


Project Name: facebookresearch/pytext
Commit Name: faccba193e28ce1b7e532052a14f55101b71a2e5
Time: 2018-12-18
Author: mikaell@fb.com
File Name: tests/pretrained_embeds_test.py
Class Name: PretrainedEmbedsTest
Method Name: test_assing_pretrained_xlu_weights


Project Name: facebookresearch/pytext
Commit Name: faccba193e28ce1b7e532052a14f55101b71a2e5
Time: 2018-12-18
Author: mikaell@fb.com
File Name: tests/pretrained_embeds_test.py
Class Name: PretrainedEmbedsTest
Method Name: test_assing_pretrained_weights