create_ball_mapper_object: Ball Mapper

View source: R/baskin_robbins.R

create_ball_mapper_objectR Documentation

Ball Mapper

Description

Run Mapper using the identity function as a lens and an \varepsilon-net cover, greedily generated using a distance matrix.

Usage

create_ball_mapper_object(data, dists, eps)

Arguments

data

A data frame.

dists

A distance matrix for the data frame. Can be a dist object or a matrix.

eps

A positive real number for the desired ball radius.

Value

A list of two data frames, nodes and edges, which contain information about the Mapper graph constructed from the given parameters.

The node data frame consists of:

  • id: vertex ID

  • cluster_size: number of data points in vertex

  • mean_dist_to_medoid: mean distance to medoid of vertex

  • data: names of data points in cluster

The edge data frame contains consists of:

  • source: vertex ID of edge source

  • target: vertex ID of edge target

  • weight: Jaccard index of edge; this is the size of the intersection between the vertices divided by the union

  • overlap_data: names of data points in overlap

  • overlap_size: number of data points overlap

Examples

# Create noisy cirle data set
data = data.frame(x = sapply(1:100, function(x) cos(x)), y = sapply(1:100, function(x) sin(x)))

# Set ball radius
eps = .5

# Create Mapper object
create_ball_mapper_object(data, dist(data), eps)

mappeR documentation built on June 29, 2025, 1:07 a.m.