View source: R/find_recommended_path.R
find_recommended_path | R Documentation |
This function identifies a recommended path in a tree structure based on user-defined minimum criteria. It filters nodes based on the number of leaves and calculates scores for potential recommendations.
find_recommended_path(minidend, window_data, min_card)
minidend |
A tree structure representing the hierarchy of nodes, from which leaves will be derived for analysis. |
window_data |
A matrix or data frame containing data associated with each node. |
min_card |
An integer specifying the minimum number of leaves that must be present in a node for it to be considered for recommendation. |
The function follows these steps:
1. Extracts the leaves and heights of each node in the tree.
2. Filters nodes based on the minimum number of leaves specified by min_card
.
3. Identifies nodes that are parents of the filtered nodes, marking them for deletion.
4. For each seed node, calculates crossing points with other seed nodes.
5. Calculates adjusted scores for nodes in the seed path using the C++ function fMSR_adj
.
6. Recommends nodes based on calculated scores and returns a summary of results.
A list containing:
- seed_path_info
: A data frame summarizing the valid seed nodes, their number of leaves,
heights, and recommended nodes.
- seed_path_list
: A list containing the names of elements for each node in the seed path.
- score_path_list
: A list of scores adjusted for each node in the seed path.
- recommended_node_labels
: A list of labels for the recommended nodes.
- recommended_node_scores
: A numeric vector containing scores for the recommended nodes.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.