Silhouette | R Documentation |
Computes persistence silhouettes from a list of persistence diagrams. A persistence silhouette is computed by taking a weighted average of the collection of 1D piecewise-linear functions given by the persistence landscapes, and then by evenly sampling this average on a given range. Finally, the corresponding vector of samples is returned. See https://arxiv.org/abs/1312.0308 for more details.
rgudhi::PythonClass
-> rgudhi::SKLearnClass
-> rgudhi::VectorRepresentationStep
-> Silhouette
rgudhi::PythonClass$get_python_class()
rgudhi::PythonClass$set_python_class()
rgudhi::SKLearnClass$get_params()
rgudhi::SKLearnClass$set_params()
rgudhi::VectorRepresentationStep$apply()
rgudhi::VectorRepresentationStep$fit()
rgudhi::VectorRepresentationStep$fit_transform()
rgudhi::VectorRepresentationStep$transform()
new()
The Silhouette
constructor.
Silhouette$new(weight = ~1, resolution = 100, sample_range = rep(NA_real_, 2))
weight
A function or a formula coercible into a function via
rlang::as_function()
specifying the weight function for the
persistence diagram points. Defaults to the constant function ~ 1
.
This function must be defined on 2D points, i.e. lists or arrays of the
form [p_x,p_y]
.
resolution
An length-1 integer vector specifying the size (in
pixels) of the persistence image. Defaults to rep(20L, 2)
.
sample_range
A length-2 numeric vector specifying the domain for
the entropy summary function, of the form [x_{\min}, x_{\max}]
.
Defaults to rep(NA, 2)
. It is the interval on which samples will be
drawn evenly. If one of the values is NA
, it can be computed from the
persistence diagrams with the $fit()
method.
An object of class Silhouette
.
clone()
The objects of this class are cloneable with this method.
Silhouette$clone(deep = FALSE)
deep
Whether to make a deep clone.
Mathieu Carrière
X <- seq_circle(10)
ac <- AlphaComplex$new(points = X)
st <- ac$create_simplex_tree()
dgm <- st$compute_persistence()$persistence_intervals_in_dimension(0)
ds <- DiagramSelector$new(use = TRUE)
dgm <- ds$apply(dgm)
sil <- Silhouette$new()
sil$apply(dgm) # TO DO: fix gd because it does not set sample_range automatically
sil$fit_transform(list(dgm))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.