class_docstr: A class for wälder, that are phylogenetic forests, elements of the Wald Space.
  
  Parameters
  ----------
  topology : Topology
      The structure of the forest.
  weights : array-like
      The edge weights, array of floats between 0 and 1, with m entries, where m is
      the total number of splits/edges in the structure ``top``.
class_docstr_tok: ["A","class","for","w\u00e4lder",",","that","are","phylogenetic","forests",",","elements","of","the","Wald","Space",".","Parameters","--","--","--","--","--","topology",":","Topology","The","structure","of","the","forest",".","weights",":","array-like","The","edge","weights",",","array","of","floats","between","0","and","1",",","with","m","entries",",","where","m","is","the","total","number","of","splits\/edges","in","the","structure","``","top","``","."]
docstr: Generate a random instance of class ``Wald``.
  
  Parameters
  ----------
  n_labels : int
      The number of labels the wald is generated with respect to.
  p_keep : float
      The probability will be inserted into the generation of a partition as
      well as for the generation of a split set for the topology of the wald.
  p_new : float
      A float between 0 and 1, the probability that no new component is added,
      and probability of 1 - p_new_ that a new component is added.
  btol: float
      Tolerance for the boundary of the coordinates in each grove. Defaults to
      1e-08.
  check : bool
      If True, checks if splits still separate all labels. In this case, the split
      will not be deleted. If False, any split can be randomly deleted.
  
  Returns
  -------
  random_wald : Wald
      The randomly generated wald.
code: def generate_wald(n_labels, p_keep, p_new, btol=10**-8, check=True):
      """Generate a random instance of class ``Wald``.
  
      Parameters
      ----------
      n_labels : int
          The number of labels the wald is generated with respect to.
      p_keep : float
          The probability will be inserted into the generation of a partition as
          well as for the generation of a split set for the topology of the wald.
      p_new : float
          A float between 0 and 1, the probability that no new component is added,
          and probability of 1 - p_new_ that a new component is added.
      btol: float
          Tolerance for the boundary of the coordinates in each grove. Defaults to
          1e-08.
      check : bool
          If True, checks if splits still separate all labels. In this case, the split
          will not be deleted. If False, any split can be randomly deleted.
  
      Returns
      -------
      random_wald : Wald
          The randomly generated wald.
      """
      partition = Wald._generate_partition(
          n_labels=n_labels, p_new=p_new
      )
      split_sets = [
          Wald._generate_splits(labels=_part) for _part in partition
      ]
      split_sets = [
          Wald._delete_splits(
              splits=splits, labels=part, p_keep=p_keep, check=check
          )
          for part, splits in zip(partition, split_sets)
      ]
      top = Topology(
          n_labels=n_labels, partition=partition, split_sets=split_sets
      )
      x = gs.random.uniform(
          size=(len(top.flatten(split_sets)),), low=0, high=1
      )
      x = gs.minimum(gs.maximum(btol, x), 1 - btol)
      return Wald(topology=top, weights=x)
  
imports: import functools
  import itertools
  import geomstats.backend
  import geomstats.geometry.spd_matrices
  from geomstats.geometry.stratified.point_set import Point, PointSet, _vectorize_point
label_desc: Use image node_id 12 for calling the Wald obj's underlying member method code with example usage: obj.generate_wald(n_labels, p_keep, p_new, btol, check) and returns: Wald