(self, selected_instance)
return [self._oracle_ind_name_dict[i] for i in selected_oracles]
Select oracle to query by providing the index of selected instance.

        Parameters
        ----------
        selected_instance: int
            The indexes of selected samples. Should be a member of unlabeled set.

        Returns
        -------
        selected_oracles: list
            The selected oracles for querying.
Select oracle to query by providing the index of selected instance.
Select oracle to query by providing the index of selected instance .
def select_by_given_instance(self, selected_instance):
        """Select oracle to query by providing the index of selected instance.

        Parameters
        ----------
        selected_instance: int
            The indexes of selected samples. Should be a member of unlabeled set.

        Returns
        -------
        selected_oracles: list
            The selected oracles for querying.
        """
        selected_oracles = np.nonzero(self._UI >= self.epsilon * np.max(self._UI))
        selected_oracles = selected_oracles[0]

        # update UI(a) for each selected oracle
        labeling_results = []
        for i in selected_oracles:
            lab, _ = self._oracles[self._oracle_ind_name_dict[i]].query_by_index(selected_instance)
            labeling_results.append(lab[0])
            self._oracles_history[i][selected_instance] = copy.copy(lab[0])
        _, majority_vote_result = majority_vote(labeling_results)
        reward_arr = np.zeros(len(selected_oracles))
        same_ind = np.nonzero(labeling_results == majority_vote_result)[0]
        reward_arr[same_ind] = 1
        self._majority_vote_results[selected_instance] = majority_vote_result
        for i in selected_oracles:
            self._UI[i] = self._calc_uia(self._oracles_history[i], self._majority_vote_results)

        # return results
        return [self._oracle_ind_name_dict[i] for i in selected_oracles]
def select_by_given_instance ( self , selected_instance ) : selected_oracles = np . nonzero ( self . _UI >= self . epsilon * np . max ( self . _UI ) ) selected_oracles = selected_oracles [ 0 ] # update UI(a) for each selected oracle labeling_results = [ ] for i in selected_oracles : lab , _ = self . _oracles [ self . _oracle_ind_name_dict [ i ] ] . query_by_index ( selected_instance ) labeling_results . append ( lab [ 0 ] ) self . _oracles_history [ i ] [ selected_instance ] = copy . copy ( lab [ 0 ] ) _ , majority_vote_result = majority_vote ( labeling_results ) reward_arr = np . zeros ( len ( selected_oracles ) ) same_ind = np . nonzero ( labeling_results == majority_vote_result ) [ 0 ] reward_arr [ same_ind ] = 1 self . _majority_vote_results [ selected_instance ] = majority_vote_result for i in selected_oracles : self . _UI [ i ] = self . _calc_uia ( self . _oracles_history [ i ] , self . _majority_vote_results ) # return results return [ self . _oracle_ind_name_dict [ i ] for i in selected_oracles ]