branches: Extract all branches of the Vistla tree

View source: R/paths.R

branchesR Documentation

Extract all branches of the Vistla tree

Description

Gives access to a list of all branches in the tree.

Usage

branches(x, suboptimal = FALSE)

## S3 method for class 'vistla'
as.data.frame(x, row.names = NULL, optional = FALSE, suboptimal = FALSE, ...)

Arguments

x

vistla object.

suboptimal

if TRUE, sub-optimal branches are included.

row.names

passed to as.data.frame.

optional

passed to as.data.frame.

...

ignored.

Value

A data frame collecting all branches traced by vistla. Each row corresponds to a single branch, i.e., edge between feature pairs. This way it is a triplet of original features, names of which are stored in a, b and c columns. For instance, path I \rightarrow J \rightarrow K \rightarrow L \rightarrow M would be stored in three rows, for (a,b,c)=(I,J,K), (J,K,L) and (K,L,M). The width of a path (minimal \iota value) between root and feature pair (b,c) is stored in the score column. depth stores the path depth, starting from 1 for pairs directly connected to the root, and increasing by one for each additional feature. Final column, leaf, is a logical path indicating whether the edge is a final segment of the widest path between root and c.

Note

Pruned trees (obtained with prune and using targets argument in the vistla call) have no suboptimal branches.


vistla documentation built on Oct. 5, 2023, 5:08 p.m.

Related to branches in vistla...