Пример #1
0
    def test_feature_binning(self):
        binning_guest = HeteroFeatureBinningGuest()

        guest_param = self._make_param_dict('fit')

        binning_guest.run(guest_param, self.args)

        result_data = binning_guest.save_data()
        local_data = result_data.collect()
        print("data in fit")
        for k, v in local_data:
            print("k: {}, v: {}".format(k, v.features))
        guest_model = {self.model_name: binning_guest.export_model()}

        guest_args = {
            'data': {
                self.model_name: {
                    'data': self.table
                }
            },
            'model': guest_model
        }

        binning_guest = HeteroFeatureBinningGuest()

        guest_param = self._make_param_dict('transform')

        binning_guest.run(guest_param, guest_args)

        result_data = binning_guest.save_data()
        local_data = result_data.collect()
        print("data in transform")
        for k, v in local_data:
            print("k: {}, v: {}".format(k, v.features))
Пример #2
0
    def run_data(self, table_args, run_type='fit'):
        if self.binning_obj is not None:
            return self.binning_obj
        if self.role == GUEST:
            binning_obj = HeteroFeatureBinningGuest()
        else:
            binning_obj = HeteroFeatureBinningHost()
        guest_param = self._make_param_dict(run_type)

        binning_obj.run(guest_param, table_args)
        self.binning_obj = binning_obj
        return binning_obj
    def run_data(self, table_args, run_type='fit'):
        if self.binning_obj is not None:
            return self.binning_obj
        if self.role == GUEST:
            binning_obj = HeteroFeatureBinningGuest()
        else:
            binning_obj = HeteroFeatureBinningHost()

        # param_obj = FeatureBinningParam(method=consts.QUANTILE)
        # binning_obj.model_param = param_obj
        guest_param = self._make_param_dict(run_type)
        binning_obj.run(guest_param, table_args)
        print("current binning method: {}, split_points: {}".format(
            binning_obj.model_param.method,
            binning_obj.binning_obj.split_points))
        self.binning_obj = binning_obj
        return binning_obj