(self, bin_sum, partitions)
return result_table
Convert bin sum result, which typically get from host, to bucket list
        Parameters
        ----------
        bin_sum : dict
           {'x1': [[event_count, non_event_count], [event_count, non_event_count] ... ],
             'x2': [[event_count, non_event_count], [event_count, non_event_count] ... ],
             ...
            }

        partitions: int
            Indicate partitions for created table.

        Returns
        -------
        A Table whose keys are feature names and values are bucket lists
Convert bin sum result, which typically get from host, to bucket list
        Parameters
        ----------
        bin_sum : dict
           {'x1': [[event_count, non_event_count], [event_count, non_event_count] ... ],
             'x2': [[event_count, non_event_count], [event_count, non_event_count] ... ],
             ...
            }
Convert bin sum result which typically get from host to bucket list Parameters ---------- bin_sum : dict { x1 : [[ event_count non_event_count ] [ event_count non_event_count ] ... ] x2 : [[ event_count non_event_count ] [ event_count non_event_count ] ... ] ... }
def bin_sum_to_bucket_list(self, bin_sum, partitions):
        """
        Convert bin sum result, which typically get from host, to bucket list
        Parameters
        ----------
        bin_sum : dict
           {'x1': [[event_count, non_event_count], [event_count, non_event_count] ... ],
             'x2': [[event_count, non_event_count], [event_count, non_event_count] ... ],
             ...
            }

        partitions: int
            Indicate partitions for created table.

        Returns
        -------
        A Table whose keys are feature names and values are bucket lists
        """
        bucket_dict = dict()
        for col_name, bin_res_list in bin_sum.items():

            bucket_list = []
            for b_idx in range(len(bin_res_list)):
                bucket = bucket_info.Bucket(b_idx, self.adjustment_factor)
                if b_idx == 0:
                    bucket.set_left_neighbor(None)
                if b_idx == len(bin_res_list) - 1:
                    bucket.set_right_neighbor(None)
                bucket.event_count = bin_res_list[b_idx][0]
                bucket.non_event_count = bin_res_list[b_idx][1]
                bucket.left_bound = b_idx - 1
                bucket.right_bound = b_idx
                bucket.event_total = self.event_total
                bucket.non_event_total = self.non_event_total
                bucket_list.append(bucket)
            bucket_dict[col_name] = bucket_list

        result = []
        for col_name, bucket_list in bucket_dict.items():
            result.append((col_name, bucket_list))
        result_table = session.parallelize(result,
                                           include_key=True,
                                           partition=partitions)
        return result_table
def bin_sum_to_bucket_list ( self , bin_sum , partitions ) : bucket_dict = dict ( ) for col_name , bin_res_list in bin_sum . items ( ) : bucket_list = [ ] for b_idx in range ( len ( bin_res_list ) ) : bucket = bucket_info . Bucket ( b_idx , self . adjustment_factor ) if b_idx == 0 : bucket . set_left_neighbor ( None ) if b_idx == len ( bin_res_list ) - 1 : bucket . set_right_neighbor ( None ) bucket . event_count = bin_res_list [ b_idx ] [ 0 ] bucket . non_event_count = bin_res_list [ b_idx ] [ 1 ] bucket . left_bound = b_idx - 1 bucket . right_bound = b_idx bucket . event_total = self . event_total bucket . non_event_total = self . non_event_total bucket_list . append ( bucket ) bucket_dict [ col_name ] = bucket_list result = [ ] for col_name , bucket_list in bucket_dict . items ( ) : result . append ( ( col_name , bucket_list ) ) result_table = session . parallelize ( result , include_key = True , partition = partitions ) return result_table