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: Update the tree (upwards procedure).
  
  Parameters
  ----------
  leaf
      Leaf to start from when going upward.
docstr_tok: ["Update","the","tree","(","upwards","procedure",")",".","Parameters","--","--","--","--","--","leaf","Leaf","to","start","from","when","going","upward","."]
code: def _go_upwards(self, leaf: MondrianLeafClassifier):
      """Update the tree (upwards procedure).
  
      Parameters
      ----------
      leaf
          Leaf to start from when going upward.
  
      """
  
      current_node = leaf
  
      if self.iteration >= 1:
          while True:
              current_node.update_weight_tree()
              if current_node.parent is None:
                  # We arrived at the root
                  break
              # Note that the root node is updated as well
              # We go up to the root in the tree
              current_node = current_node.parent
  
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 12 for calling the MondrianTreeClassifier obj's underlying member method code with example usage: obj._go_upwards(leaf) without return types