(self, data_instances)
return data_instances
Apply binning method for both data instances in local party as well as the other one. Afterwards, calculate
        the specific metric value for specific columns.
Apply binning method for both data instances in local party as well as the other one. Afterwards, calculate
        the specific metric value for specific columns.
Apply binning method for both data instances in local party as well as the other one . Afterwards calculate the specific metric value for specific columns .
def fit(self, data_instances):
        """
        Apply binning method for both data instances in local party as well as the other one. Afterwards, calculate
        the specific metric value for specific columns.
        """
        self._abnormal_detection(data_instances)

        # self._parse_cols(data_instances)
        self._setup_bin_inner_param(data_instances, self.model_param)

        if self.model_param.method == consts.OPTIMAL:
            has_missing_value = self.iv_calculator.check_containing_missing_value(data_instances)
            for idx in self.bin_inner_param.bin_indexes:
                if idx in has_missing_value:
                    raise ValueError(f"Optimal Binning do not support missing value now.")

        # Calculates split points of datas in self party
        split_points = self.binning_obj.fit_split_points(data_instances)
        if self.model_param.skip_static:
            if self.transform_type != 'woe':
                data_instances = self.transform(data_instances)
            else:
                raise ValueError("Woe transform is not supported in host parties.")
            self.set_schema(data_instances)
            self.data_output = data_instances
            return data_instances

        if not self.model_param.local_only:
            self.compressor = CipherCompressorHost()
            self._sync_init_bucket(data_instances, split_points)
            if self.model_param.method == consts.OPTIMAL:
                self.optimal_binning_sync()

        if self.transform_type != 'woe':
            data_instances = self.transform(data_instances)
        self.set_schema(data_instances)
        self.data_output = data_instances
        total_summary = self.binning_obj.bin_results.to_json()
        self.set_summary(total_summary)
        return data_instances
def fit ( self , data_instances ) : self . _abnormal_detection ( data_instances ) # self._parse_cols(data_instances) self . _setup_bin_inner_param ( data_instances , self . model_param ) if self . model_param . method == consts . OPTIMAL : has_missing_value = self . iv_calculator . check_containing_missing_value ( data_instances ) for idx in self . bin_inner_param . bin_indexes : if idx in has_missing_value : raise ValueError ( f"Optimal Binning do not support missing value now." ) # Calculates split points of datas in self party split_points = self . binning_obj . fit_split_points ( data_instances ) if self . model_param . skip_static : if self . transform_type != 'woe' : data_instances = self . transform ( data_instances ) else : raise ValueError ( "Woe transform is not supported in host parties." ) self . set_schema ( data_instances ) self . data_output = data_instances return data_instances if not self . model_param . local_only : self . compressor = CipherCompressorHost ( ) self . _sync_init_bucket ( data_instances , split_points ) if self . model_param . method == consts . OPTIMAL : self . optimal_binning_sync ( ) if self . transform_type != 'woe' : data_instances = self . transform ( data_instances ) self . set_schema ( data_instances ) self . data_output = data_instances total_summary = self . binning_obj . bin_results . to_json ( ) self . set_summary ( total_summary ) return data_instances