phylo2vec.sample_matrix#
- phylo2vec.sample_matrix(n_leaves: int, ordered: bool = False) ndarray[source]#
Sample a random tree with branch lengths via Phylo2Vec, in matrix form.
- Parameters:
n_leaves (int) – Number of leaves (>= 2)
ordered (bool, optional) – If True, sample an ordered tree, by default False
- Returns:
Phylo2Vec matrix Dimensions (n_leaves, 3) 1st column: Phylo2Vec vector 2nd and 3rd columns: branch lengths of cherry [i] in the ancestry matrix
- Return type:
numpy.ndarray