class_docstr: Gini Impurity split criterion.
code: def merit_of_split(self, pre_split_dist, post_split_dist):
      if (
          self.num_subsets_greater_than_frac(
              post_split_dist, self.min_branch_fraction
          )
          < 2
      ):
          return -math.inf
  
      total_weight = 0.0
      dist_weights = [0.0] * len(post_split_dist)
      for i in range(len(post_split_dist)):
          dist_weights[i] = sum(post_split_dist[i].values())
          total_weight += dist_weights[i]
      gini = 0.0
      for i in range(len(post_split_dist)):
          gini += (dist_weights[i] / total_weight) * self.compute_gini(
              post_split_dist[i], dist_weights[i]
          )
      return 1.0 - gini
  
file_path: river/river/tree/split_criterion/gini_split_criterion.py
imports: from __future__ import annotations
  import math
  from .base import SplitCriterion
label_desc: Use image node_id 2 for calling the GiniSplitCriterion obj's underlying member method code with example usage: obj.merit_of_split(pre_split_dist, post_split_dist) and returns: unknown, unknown