(self, label_index, unlabel_index, predict)
return [selected_instance], self.select_by_given_instance(selected_instance)
Query from oracles. Return the index of selected instance and oracle.

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

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

        predict: : 2d array, shape [n_samples, n_classes]
            The probabilistic prediction matrix for the unlabeled set.

        Returns
        -------
        selected_instance: int
            The index of selected instance. Selected by uncertainty.

        selected_oracles: list
            The selected oracles for querying.
Query from oracles. Return the index of selected instance and oracle.
Query from oracles . Return the index of selected instance and oracle .
def select_by_prediction_mat(self, label_index, unlabel_index, predict):
        """Query from oracles. Return the index of selected instance and oracle.

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

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

        predict: : 2d array, shape [n_samples, n_classes]
            The probabilistic prediction matrix for the unlabeled set.

        Returns
        -------
        selected_instance: int
            The index of selected instance. Selected by uncertainty.

        selected_oracles: list
            The selected oracles for querying.
        """
        # Check parameter and initialize variables
        assert (isinstance(unlabel_index, collections.Iterable))
        assert (isinstance(label_index, collections.Iterable))
        unlabel_index = np.asarray(unlabel_index)
        label_index = np.asarray(label_index)
        if len(unlabel_index) <= 1:
            return unlabel_index

        # select instance and oracle
        unc = QueryInstanceUncertainty(measure='least_confident')
        selected_instance = unc.select_by_prediction_mat(unlabel_index=unlabel_index, predict=predict, batch_size=1)[0]
        return [selected_instance], self.select_by_given_instance(selected_instance)
def select_by_prediction_mat ( self , label_index , unlabel_index , predict ) : # Check parameter and initialize variables assert ( isinstance ( unlabel_index , collections . Iterable ) ) assert ( isinstance ( label_index , collections . Iterable ) ) unlabel_index = np . asarray ( unlabel_index ) label_index = np . asarray ( label_index ) if len ( unlabel_index ) <= 1 : return unlabel_index # select instance and oracle unc = QueryInstanceUncertainty ( measure = 'least_confident' ) selected_instance = unc . select_by_prediction_mat ( unlabel_index = unlabel_index , predict = predict , batch_size = 1 ) [ 0 ] return [ selected_instance ] , self . select_by_given_instance ( selected_instance )