(self, select_index, label, cost=None, example=None)
return self
Add an element to the repository.

        Parameters
        ----------
        select_index: int or tuple
            The selected index in active learning.

        label: object
            Supervised information given by the oracle.

        cost: object, optional (default=None)
            Cost produced by querying, given by the oracle.

        example: object, optional (default=None)
            Instance for adding.
Add an element to the repository.
Add an element to the repository .
def add(self, select_index, label, cost=None, example=None):
        """Add an element to the repository.

        Parameters
        ----------
        select_index: int or tuple
            The selected index in active learning.

        label: object
            Supervised information given by the oracle.

        cost: object, optional (default=None)
            Cost produced by querying, given by the oracle.

        example: object, optional (default=None)
            Instance for adding.
        """
        if self._instance_flag:
            if example is None:
                raise Exception("This repository has the instance information,"
                                "must provide example parameter when adding entry")
            example = tuple(example)
            self._exa2ind[example] = select_index
            self._ind2exa[select_index] = example

        if cost is not None:
            self.cost_inall += np.sum(cost)
            self._cost_arr.append(cost)

        self._ind2label[select_index] = label
        self._indexes.append(select_index)
        return self
def add ( self , select_index , label , cost = None , example = None ) : if self . _instance_flag : if example is None : raise Exception ( "This repository has the instance information," "must provide example parameter when adding entry" ) example = tuple ( example ) self . _exa2ind [ example ] = select_index self . _ind2exa [ select_index ] = example if cost is not None : self . cost_inall += np . sum ( cost ) self . _cost_arr . append ( cost ) self . _ind2label [ select_index ] = label self . _indexes . append ( select_index ) return self