class_docstr: Numeric attribute observer for classification tasks that discretizes features
  using histograms.
  
  
  Parameters
  ----------
  n_bins
      The maximum number of bins in the histogram.
  n_splits
      The number of split points to evaluate when querying for the best split
      candidate.
class_docstr_tok: ["Numeric","attribute","observer","for","classification","tasks","that","discretizes","features","using","histograms",".","Parameters","--","--","--","--","--","n_bins","The","maximum","number","of","bins","in","the","histogram",".","n_splits","The","number","of","split","points","to","evaluate","when","querying","for","the","best","split","candidate","."]
code: def best_evaluated_split_suggestion(
      self, criterion, pre_split_dist, att_idx, binary_only
  ):
      best_suggestion = BranchFactory()
  
      low = min(h[0].right for h in self.hists.values())
      high = min(h[-1].right for h in self.hists.values())
  
      # If only one single value has been observed, then no split can be proposed
      if low >= high:
          return best_suggestion
  
      n_thresholds = min(
          self.n_splits, max(map(len, self.hists.values())) - 1
      )
  
      thresholds = list(
          decimal_range(start=low, stop=high, num=n_thresholds)
      )
      cdfs = {
          y: hist.iter_cdf(thresholds) for y, hist in self.hists.items()
      }
  
      total_weight = sum(pre_split_dist.values())
      for at in thresholds:
          l_dist = {}
          r_dist = {}
  
          for y in pre_split_dist:
              if y in cdfs:
                  p_xy = next(cdfs[y])  # P(x <= t | y)
                  p_y = pre_split_dist[y] / total_weight  # P(y)
                  l_dist[y] = total_weight * p_y * p_xy  # P(y | x <= t)
                  r_dist[y] = (
                      total_weight * p_y * (1 - p_xy)
                  )  # P(y | x > t)
  
          post_split_dist = [l_dist, r_dist]
          merit = criterion.merit_of_split(
              pre_split_dist, post_split_dist
          )
  
          if merit > best_suggestion.merit:
              best_suggestion = BranchFactory(
                  merit, att_idx, at, post_split_dist
              )
  
      return best_suggestion
  
file_path: river/river/tree/splitter/histogram_splitter.py
imports: from __future__ import annotations
  import bisect
  import collections
  import functools
  from river import sketch
  from river.sketch.histogram import Bin
  from ..utils import BranchFactory
  from .base import Splitter
label_desc: Use image node_id 4 for calling the HistogramSplitter obj's underlying member method code with example usage: obj.best_evaluated_split_suggestion(criterion, pre_split_dist, att_idx, binary_only) and returns: best_suggestion, best_suggestion