(self, intersect_obj, data_inst, guest_side=False)
return data_loader, data_loader.x_shape, data_inst.count(), len(data_loader.get_overlap_indexes())
find intersect ids and prepare dataloader
find intersect ids and prepare dataloader
find intersect ids and prepare dataloader
def prepare_data(self, intersect_obj, data_inst, guest_side=False):

        """
        find intersect ids and prepare dataloader
        """
        if guest_side:
            data_inst = self.check_label(data_inst)

        overlap_samples = intersect_obj.run_intersect(data_inst)  # find intersect ids
        overlap_samples = intersect_obj.get_value_from_data(overlap_samples, data_inst)
        non_overlap_samples = data_inst.subtractByKey(overlap_samples)

        LOGGER.debug('num of overlap/non-overlap sampels: {}/{}'.format(overlap_samples.count(),
                                                                        non_overlap_samples.count()))

        if overlap_samples.count() == 0:
            raise ValueError('no overlap samples')

        if guest_side and non_overlap_samples == 0:
            raise ValueError('overlap samples are required in guest side')

        self.store_header = data_inst.schema['header']
        LOGGER.debug('data inst header is {}'.format(self.store_header))

        LOGGER.debug('has {} overlap samples'.format(overlap_samples.count()))

        batch_size = self.batch_size
        if self.batch_size == -1:
            batch_size = data_inst.count() + 1  # make sure larger than sample number
        data_loader = FTLDataLoader(non_overlap_samples=non_overlap_samples,
                                    batch_size=batch_size, overlap_samples=overlap_samples, guest_side=guest_side)

        LOGGER.debug("data details are :{}".format(data_loader.data_basic_info()))

        return data_loader, data_loader.x_shape, data_inst.count(), len(data_loader.get_overlap_indexes())
def prepare_data ( self , intersect_obj , data_inst , guest_side = False ) : if guest_side : data_inst = self . check_label ( data_inst ) overlap_samples = intersect_obj . run_intersect ( data_inst ) # find intersect ids overlap_samples = intersect_obj . get_value_from_data ( overlap_samples , data_inst ) non_overlap_samples = data_inst . subtractByKey ( overlap_samples ) LOGGER . debug ( 'num of overlap/non-overlap sampels: {}/{}' . format ( overlap_samples . count ( ) , non_overlap_samples . count ( ) ) ) if overlap_samples . count ( ) == 0 : raise ValueError ( 'no overlap samples' ) if guest_side and non_overlap_samples == 0 : raise ValueError ( 'overlap samples are required in guest side' ) self . store_header = data_inst . schema [ 'header' ] LOGGER . debug ( 'data inst header is {}' . format ( self . store_header ) ) LOGGER . debug ( 'has {} overlap samples' . format ( overlap_samples . count ( ) ) ) batch_size = self . batch_size if self . batch_size == - 1 : batch_size = data_inst . count ( ) + 1 # make sure larger than sample number data_loader = FTLDataLoader ( non_overlap_samples = non_overlap_samples , batch_size = batch_size , overlap_samples = overlap_samples , guest_side = guest_side ) LOGGER . debug ( "data details are :{}" . format ( data_loader . data_basic_info ( ) ) ) return data_loader , data_loader . x_shape , data_inst . count ( ) , len ( data_loader . get_overlap_indexes ( ) )