Description Usage Arguments Details Author(s) References Examples
View source: R/landmarks-maxmin.r
Compute landmark sets based on fixed-radius balls.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | minmax(x, y = NULL, dist_method = "euclidean")
maxmin(x, y = NULL, dist_method = "euclidean")
landmarks_maxmin(
x,
dist_method = "euclidean",
pick_method = "first",
num = NULL,
radius = NULL,
frac = FALSE,
seed_index = 1L,
engine = NULL,
cover = FALSE,
extend_num = extension(mult = 0, add = 0),
extend_radius = extension(mult = 0, add = 0)
)
|
x |
a data matrix. |
y |
a data matrix of the same dimension as |
dist_method |
a character string specifying the distance metric to use;
passed to |
pick_method |
a character string specifying the method for selecting one
among indistinguishable points, either |
num |
a positive integer; the desired number of landmark points, or of sets in a ball cover. |
radius |
a positive number; the desired radius of each landmark ball, or of each set in a ball cover. |
frac |
logical; whether to treat |
seed_index |
an integer (the first landmark to seed the algorithm) or
one of the character strings |
engine |
character string specifying the implementation to use; one of
|
cover |
logical; whether to return a data frame of landmark indices and cover sets (by member index) rather than only a vector of landmark indices. |
extend_num, extend_radius |
length-two numeric vectors used to extend
landmark parameters for cover set construction. See |
This function uses the maxmin procedure to produce a set of evenly spaced landmark points from a data set. Maxmin is a simple greedy algorithm that is relatively efficient, but it has a tendency to pick out extremal points.
One, both, or neither of num
and radius
may be passed values. If
neither is specified, then num
is defaulted to 24L
. If the values yield
balls that do not cover x
, then their number is increased until the
radius necessary to cover x
is at most radius
. To generte a complete
landmark set, use radius = 0L
.
Matt Piekenbrock
Jason Cory Brunson
Yara Skaf
De Silva, Vin, and Gunnar E. Carlsson. "Topological estimation using witness complexes." SPBG 4 (2004): 157-166.
Dłotko, Paweł. "Ball Mapper: A Shape Summary for Topological Data Analysis." (2019). Web.
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(3)
# small circle sample
X <- tdaunif::sample_circle(n = 12L)
# random seed index
l <- landmarks_maxmin(X, seed_index = "random")
# plot landmark order at point positions
plot(X, asp = 1, pch = NA)
text(X, labels = order(l))
# minmax seed index
l <- landmarks_maxmin(X, seed_index = "minmax")
# plot landmark order at point positions
plot(X, asp = 1, pch = NA)
text(X, labels = order(l))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.