Skip to contents

Computes persistence landscapes from a list of persistence diagrams. A persistence landscape is a collection of 1D piecewise-linear functions computed from the rank function associated to the persistence diagram. These piecewise-linear functions are then sampled evenly on a given range and the corresponding vectors of samples are concatenated and returned. See http://jmlr.org/papers/v16/bubenik15a.html for more details.

Author

Mathieu Carrière

Super classes

rgudhi::PythonClass -> rgudhi::SKLearnClass -> rgudhi::VectorRepresentationStep -> Landscape

Methods

Inherited methods


Method new()

The Landscape constructor.

Usage

Landscape$new(
  num_landscapes = 5,
  resolution = 100,
  sample_range = rep(NA_real_, 2)
)

Arguments

num_landscapes

An integer value specifying the number of piecewise linear functions to output. Defaults to 5L.

resolution

An integer value specifying the grid size for the landscapes. Defaults to 100L.

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.

Returns

An object of class Landscape.


Method apply()

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

Usage

Landscape$apply(diag)

Arguments

diag

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

Returns

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


Method clone()

The objects of this class are cloneable with this method.

Usage

Landscape$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)
lds <- Landscape$new()
lds$apply(dgm)
lds$fit_transform(list(dgm))
}