Learn R Programming

mappeR (version 2.2.1)

create_ball_mapper_object: 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)

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

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.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab