(self, label_index, unlabel_index, batch_size=1, **kwargs)
return new_batch
Diversity promoting active learning method that greedily forms a batch
        to minimize the maximum distance to a cluster center among all unlabeled
        datapoints.

        Parameters
        ----------
        label_index: {list, np.ndarray, IndexCollection}
            The indexes of labeled samples.

        unlabel_index: {list, np.ndarray, IndexCollection}
            The indexes of unlabeled samples.

        model: object, optional (default=None)
            Current classification model, should have the 'predict_proba' method for probabilistic output.
            If not provided, LogisticRegression with default parameters implemented by sklearn will be used.

        batch_size: int, optional (default=1)
            Selection batch size.

        Returns
        -------
          indices of points selected to minimize distance to cluster centers
Diversity promoting active learning method that greedily forms a batch
        to minimize the maximum distance to a cluster center among all unlabeled
        datapoints.
Diversity promoting active learning method that greedily forms a batch to minimize the maximum distance to a cluster center among all unlabeled datapoints .
def select(self, label_index, unlabel_index, batch_size=1, **kwargs):
        """
        Diversity promoting active learning method that greedily forms a batch
        to minimize the maximum distance to a cluster center among all unlabeled
        datapoints.

        Parameters
        ----------
        label_index: {list, np.ndarray, IndexCollection}
            The indexes of labeled samples.

        unlabel_index: {list, np.ndarray, IndexCollection}
            The indexes of unlabeled samples.

        model: object, optional (default=None)
            Current classification model, should have the 'predict_proba' method for probabilistic output.
            If not provided, LogisticRegression with default parameters implemented by sklearn will be used.

        batch_size: int, optional (default=1)
            Selection batch size.

        Returns
        -------
          indices of points selected to minimize distance to cluster centers
        """
        already_selected = [np.where(self.train_idx == id)[0].item() for id in label_index]
        self.update_distances(already_selected, only_new=True, reset_dist=False)

        new_batch = []
        self.min_distances[already_selected] = -100.0
        self.already_selected = already_selected

        for _ in range(batch_size):
            ind = np.argmax(self.min_distances)
            # New examples should not be in already selected since those points
            # should have min_distance of zero to a cluster center.
            assert ind not in self.already_selected
            assert self.train_idx[ind] in unlabel_index

            self.update_distances([ind], only_new=True, reset_dist=False)
            self.min_distances[ind] = -100.0
            new_batch.append(self.train_idx[ind])
        return new_batch
def select ( self , label_index , unlabel_index , batch_size = 1 , * * kwargs ) : already_selected = [ np . where ( self . train_idx == id ) [ 0 ] . item ( ) for id in label_index ] self . update_distances ( already_selected , only_new = True , reset_dist = False ) new_batch = [ ] self . min_distances [ already_selected ] = - 100.0 self . already_selected = already_selected for _ in range ( batch_size ) : ind = np . argmax ( self . min_distances ) # New examples should not be in already selected since those points # should have min_distance of zero to a cluster center. assert ind not in self . already_selected assert self . train_idx [ ind ] in unlabel_index self . update_distances ( [ ind ] , only_new = True , reset_dist = False ) self . min_distances [ ind ] = - 100.0 new_batch . append ( self . train_idx [ ind ] ) return new_batch