(self, data_inst, task_type, task_role)
Sample running entry

        Parameters
        ----------
        data_inst : Table
            The input data

        task_type : "homo" or "hetero"
            if task_type is "homo", it will sample standalone
            if task_type is "heterl": then sampling will be done in one side, after that
                the side sync the sample ids to another side to generated the same sample result

        task_role: "guest" or "host":
            only consider this parameter when task_type is "hetero"
            if task_role is "guest", it will firstly sample ids, and sync it to "host"
                to generate data instances with sample ids
            if task_role is "host": it will firstly get the sample ids result of "guest",
                then generate sample data by the receiving ids

        Returns
        -------
        sample_data_inst: Table
            the output sample data, same format with input
Sample running entry
Sample running entry
def run_sample(self, data_inst, task_type, task_role):
        """
        Sample running entry

        Parameters
        ----------
        data_inst : Table
            The input data

        task_type : "homo" or "hetero"
            if task_type is "homo", it will sample standalone
            if task_type is "heterl": then sampling will be done in one side, after that
                the side sync the sample ids to another side to generated the same sample result

        task_role: "guest" or "host":
            only consider this parameter when task_type is "hetero"
            if task_role is "guest", it will firstly sample ids, and sync it to "host"
                to generate data instances with sample ids
            if task_role is "host": it will firstly get the sample ids result of "guest",
                then generate sample data by the receiving ids

        Returns
        -------
        sample_data_inst: Table
            the output sample data, same format with input

        """
        LOGGER.info("begin to run sampling process")

        if task_type not in [consts.HOMO, consts.HETERO]:
            raise ValueError("{} task type not support yet".format(task_type))

        if task_type == consts.HOMO:
            return self.sample(data_inst)[0]

        elif task_type == consts.HETERO:
            if task_role == consts.GUEST:
                sample_data_inst, sample_ids = self.sample(data_inst)
                self.sync_sample_ids(sample_ids)

            elif task_role == consts.HOST:
                sample_ids = self.recv_sample_ids()
                sample_data_inst = self.sample(data_inst, sample_ids)

            else:
                raise ValueError("{} role not support yet".format(task_role))

            return sample_data_inst
def run_sample ( self , data_inst , task_type , task_role ) : LOGGER . info ( "begin to run sampling process" ) if task_type not in [ consts . HOMO , consts . HETERO ] : raise ValueError ( "{} task type not support yet" . format ( task_type ) ) if task_type == consts . HOMO : return self . sample ( data_inst ) [ 0 ] elif task_type == consts . HETERO : if task_role == consts . GUEST : sample_data_inst , sample_ids = self . sample ( data_inst ) self . sync_sample_ids ( sample_ids ) elif task_role == consts . HOST : sample_ids = self . recv_sample_ids ( ) sample_data_inst = self . sample ( data_inst , sample_ids ) else : raise ValueError ( "{} role not support yet" . format ( task_role ) ) return sample_data_inst