def cluster(self, shapelets): """ Uses a clustering algorithm to reduce the number of shapelets. :param shapelets: list of shapelet candidates :type shapelets: np.array, shape = (len(shapelets), len(s), len(dim(s))) :return: list of remaining shapelet candidates :rtype np.array, shape = (|remaining candidates|, len(s), len(dim(s))) """ clustering = Clustering(self.d_max) clustering.fit(shapelets) return clustering.nn_centers()