mapper_shannon_index: Shannon index for Mapper

View source: R/evaluation.R

mapper_shannon_indexR Documentation

Shannon index for Mapper

Description

mapper_shannon_index computes Shannon indices for nodes of a given graph from Mapper.

Usage

mapper_shannon_index(obj_mapper, group_ind)

Arguments

obj_mapper

An object of class TDAmapper.

group_ind

A vector of group names each of the samples belongs to.

Details

how it is computed

Value

A list object with two objects. The first object is the weighted average Shannon index for the whole graph. The second object is the matrix of Shannon indices for each of the nodes in the graph, where the first column is the vector of indices and the second column is the vector of node sizes.

Examples

tp_data <- chicken_generator(1)
tp_data_mapper <- mapper.sta(dat = tp_data[,2:4],
                               filter_values = tp_data$Y,
                               num_intervals = 10,
                               percent_overlap = 70)
tp_shannon <- mapper_shannon_index(tp_data_mapper, tp_data$Group)
tp_shannon


TianshuFeng/SemiMapper documentation built on Sept. 16, 2022, 10:26 p.m.