Skip to contents

Computes persistence entropy. Persistence entropy is a statistic for persistence diagrams inspired from Shannon entropy. This statistic can also be used to compute a feature vector, called the entropy summary function. See https://arxiv.org/pdf/1803.08304.pdf for more details. Note that a previous implementation was contributed by Manuel Soriano-Trigueros.

Author

Mathieu Carrière

Super classes

rgudhi::PythonClass -> rgudhi::SKLearnClass -> rgudhi::VectorRepresentationStep -> Entropy

Methods

Inherited methods


Method new()

The Entropy constructor.

Usage

Entropy$new(
  mode = c("scalar", "vector"),
  normalized = TRUE,
  resolution = 100,
  sample_range = rep(NA_real_, 2)
)

Arguments

mode

A string specifying which entropy to compute: either "scalar" for computing the entropy statistic, or "vector" for computing the entropy summary function. Defaults to "scalar".

normalized

A boolean value specifying whether to normalize the entropy summary function. Defaults to TRUE. Used only if mode == "vector".

resolution

An integer value specifying the grid size for the entropy summary function. Defaults to 100L. Used only if mode == "vector".

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. Used only if mode == "vector".

Returns

An object of class Entropy.


Method apply()

Applies the Entropy class on a single persistence diagram and outputs the result.

Usage

Entropy$apply(diag)

Arguments

diag

A 2-column tibble::tibble specifying a persistence diagram.

Returns

A tibble::tibble storing the entropy representation of the persistence diagram in a table suitable for visualization.


Method clone()

The objects of this class are cloneable with this method.

Usage

Entropy$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # reticulate::py_module_available("gudhi")
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)
ent <- Entropy$new()
ent$apply(dgm)
ent$fit_transform(list(dgm))
}