(self, ks)
Execute clustering in separate threads for all given ks.
Execute clustering in separate threads for all given ks.
Execute clustering in separate threads for all given ks .
def __launch_tasks(self, ks):
        # type: (List[int]) -> None
        """Execute clustering in separate threads for all given ks."""
        preprocessed_data = self.preproces(self.data)
        futures = [self.__executor.submit(
            self._compute_clustering,
            data=preprocessed_data,
            k=k,
            init=self.INIT_METHODS[self.smart_init][1],
            n_init=self.n_init,
            max_iter=self.max_iterations,
            random_state=RANDOM_STATE,
        ) for k in ks]
        watcher = FutureSetWatcher(futures)
        watcher.resultReadyAt.connect(self.__clustering_complete)
        watcher.progressChanged.connect(self.__progress_changed)
        watcher.exceptionReadyAt.connect(self.__on_exception)
        watcher.doneAll.connect(self.__commit_finished)

        self.__task = Task(futures, watcher)
        self.progressBarInit()
        self.setInvalidated(True)
def __launch_tasks ( self , ks ) : # type: (List[int]) -> None preprocessed_data = self . preproces ( self . data ) futures = [ self . __executor . submit ( self . _compute_clustering , data = preprocessed_data , k = k , init = self . INIT_METHODS [ self . smart_init ] [ 1 ] , n_init = self . n_init , max_iter = self . max_iterations , random_state = RANDOM_STATE , ) for k in ks ] watcher = FutureSetWatcher ( futures ) watcher . resultReadyAt . connect ( self . __clustering_complete ) watcher . progressChanged . connect ( self . __progress_changed ) watcher . exceptionReadyAt . connect ( self . __on_exception ) watcher . doneAll . connect ( self . __commit_finished ) self . __task = Task ( futures , watcher ) self . progressBarInit ( ) self . setInvalidated ( True )