(self)
gini = 1 - ∑(p_i^2 ) = 1 -（event / total）^2 - (nonevent / total)^2
gini = 1 - ∑(p_i^2 ) = 1 -（event / total）^2 - (nonevent / total)^2
gini = 1 - ∑ ( p_i^2 ) = 1 - （event / total）^2 - ( nonevent / total ) ^2
def cal_score(self):
        """
        gini = 1 - ∑(p_i^2 ) = 1 -（event / total）^2 - (nonevent / total)^2
        """

        self.event_count = self.left_bucket.event_count + self.right_bucket.event_count
        self.non_event_count = self.left_bucket.non_event_count + self.right_bucket.non_event_count
        if self.total_count == 0:
            self.score = -math.inf
            return

        # if self.total_count == 0 or self.left_bucket.left_bound == self.right_bucket.right_bound:
        #     self.score = -math.inf
        #     return
        merged_gini = 1 - (1.0 * self.event_count / self.total_count) ** 2 - \
                      (1.0 * self.non_event_count / self.total_count) ** 2
        self.score = merged_gini - self.left_bucket.gini - self.right_bucket.gini
def cal_score ( self ) : self . event_count = self . left_bucket . event_count + self . right_bucket . event_count self . non_event_count = self . left_bucket . non_event_count + self . right_bucket . non_event_count if self . total_count == 0 : self . score = - math . inf return # if self.total_count == 0 or self.left_bucket.left_bound == self.right_bucket.right_bound: #     self.score = -math.inf #     return merged_gini = 1 - ( 1.0 * self . event_count / self . total_count ) ** 2 - ( 1.0 * self . non_event_count / self . total_count ) ** 2 self . score = merged_gini - self . left_bucket . gini - self . right_bucket . gini