class_docstr: Mondrian Tree classifier.
  
  Parameters
  ----------
  step
      Step of the tree.
  use_aggregation
      Whether to use aggregation weighting techniques or not.
  dirichlet
      Dirichlet parameter of the problem.
  split_pure
      Whether the tree should split pure leafs during training or not.
  iteration
      Number iterations to do during training.
  seed
      Random seed for reproducibility.
  
  Notes
  -----
  The Mondrian Tree Classifier is a type of decision tree that bases splitting decisions over a
  Mondrian process.
  
  Examples
  --------
  >>> from river import datasets
  >>> from river import evaluate
  >>> from river import metrics
  >>> from river import tree
  
  >>> dataset = datasets.Bananas().take(500)
  
  >>> model = tree.mondrian.MondrianTreeClassifier(
  ...     step=0.1,
  ...     use_aggregation=True,
  ...     dirichlet=0.2,
  ...     seed=1
  ... )
  
  >>> metric = metrics.Accuracy()
  
  >>> evaluate.progressive_val_score(dataset, model, metric)
  Accuracy: 58.52%
  
  References
  ----------
  [^1]: Balaji Lakshminarayanan, Daniel M. Roy, Yee Whye Teh. Mondrian Forests: Efficient Online Random Forests.
      arXiv:1406.2673, pages 2-4
docstr: Predict the probability of the samples.
  
  Parameters
  ----------
  x
      Feature vector.
docstr_tok: ["Predict","the","probability","of","the","samples",".","Parameters","--","--","--","--","--","x","Feature","vector","."]
code: def predict_proba_one(self, x):
      """Predict the probability of the samples.
  
      Parameters
      ----------
      x
          Feature vector.
  
      """
  
      # If the tree hasn't seen any sample, then it should return
      # the default empty dict
  
      if not self._is_initialized:
          return {}
  
      # Initialization of the scores to output to 0
      scores = {c: 0.0 for c in self._classes}
  
      leaf = (
          self._root.traverse(x, until_leaf=True)
          if isinstance(self._root, MondrianBranchClassifier)
          else self._root
      )
  
      if not self.use_aggregation:
          return self._predict(leaf)
  
      current = leaf
  
      while True:
          # This test is useless ?
          if isinstance(current, MondrianLeafClassifier):
              scores = self._predict(current)
          else:
              weight = current.weight
              log_weight_tree = current.log_weight_tree
              w = math.exp(weight - log_weight_tree)
              # Get the predictions of the current node
              pred_new = self._predict(current)
              for c in self._classes:
                  scores[c] = (
                      0.5 * w * pred_new[c] + (1 - 0.5 * w) * scores[c]
                  )
  
          # Root must be updated as well
          if current.parent is None:
              break
  
          # And now we go up
          current = current.parent
  
      # Normalize scores to mimic a probability distribution
      return utils.norm.normalize_values_in_dict(scores, inplace=False)
  
imports: from __future__ import annotations
  import math
  from river import base, utils
  from river.tree.mondrian.mondrian_tree import MondrianTree
  from river.tree.mondrian.mondrian_tree_nodes import MondrianBranchClassifier, MondrianLeafClassifier, MondrianNodeClassifier
label_desc: Use image node_id 15 for calling the MondrianTreeClassifier obj's underlying member method code with example usage: obj.predict_proba_one(x) and returns: utils, dict, self