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)
if self.base_classifier is not None:
After Change
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)),