Assigns a distance measure to the MapperRef
instance to use in the clustering algorithm.
$use_distance_measure(measure, ...)
measure
The distance measure to use (string).
...
Extra parameters passed to the distance function. See details.
Unless the clustering_algorithm
has been replaced by the user,
by default, Mapper requires a notion of distance between objects to be defined in creating the vertices of the construction.
The distance function is determined based on the supplied measure
. measure
must be one of:
["euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski"]
or, if the proxy and parallelDist
packages are installed, any name in proxy::pr_DB$get_entry_names()
.
Additional parameters passed via ...
are passed to either dist
(or
parallelDist
if installed).
The mapper instance, with the measure field assigned.
data(noisy_circle) m <- MapperRef$new(noisy_circle) m$use_filter(noisy_circle[,1]) m$use_cover("fixed interval", number_intervals = 5, percent_overlap = 25) ## Constructs clusters with euclidean metric (default) m$use_distance_measure("euclidean") m$construct_pullback() ## Constructs clusters with p-norm (p = 1) m$use_distance_measure("Minkowski", p = 1L) m$construct_pullback()# NOT RUN { ## To see list of available measures, use: proxy::pr_DB$get_entry_names() # }