BettiCurve | R Documentation |
Computes Betti curves from persistence diagrams. There are
several modes of operation: with a given resolution (with or without a
sample_range
), with a predefined grid, and with none of the previous.
With a predefined grid, the class computes the Betti numbers at those grid
points. Without a predefined grid, if the resolution is set to NULL
, it
can be fit to a list of persistence diagrams and produce a grid that
consists of (at least) the filtration values at which at least one of those
persistence diagrams changes Betti numbers, and then compute the Betti
numbers at those grid points. In the latter mode, the exact Betti curve is
computed for the entire real line. Otherwise, if the resolution is given,
the Betti curve is obtained by sampling evenly using either the given
sample_range
or based on the persistence diagrams.
rgudhi::PythonClass
-> rgudhi::SKLearnClass
-> rgudhi::VectorRepresentationStep
-> BettiCurve
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 BettiCurve
constructor.
BettiCurve$new( resolution = 100, sample_range = rep(NA, 2), predefined_grid = NULL )
resolution
An integer value specifying the number of sample for
the piecewise constant function. Defaults to 100L
.
sample_range
A length-2 numeric vector specifying the minimum and
maximum of the piecewise constant function domain, 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.
predefined_grid
A numeric vector specifying a predefined grid of
points at which to compute the Betti curves. Must be strictly ordered.
Infinities are ok. If set to NULL
(default), and resolution is given,
the grid will be uniform from x_{\min}
to x_{\max}
in
resolution
steps, otherwise a grid will be computed that captures all
changes in Betti numbers in the provided data.
An object of class BettiCurve
.
clone()
The objects of this class are cloneable with this method.
BettiCurve$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)
bc <- BettiCurve$new()
bc$apply(dgm)
bc$fit_transform(list(dgm))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.