Computes the Wasserstein distance matrix from a list of persistence diagrams.
Super classes
rgudhi::PythonClass -> rgudhi::SKLearnClass -> rgudhi::MetricStep -> WassersteinDistance
Methods
Method new()
The WassersteinDistance constructor.
Usage
WassersteinDistance$new(
order = 1,
internal_p = Inf,
mode = c("hera", "pot"),
delta = 0.01,
n_jobs = 1
)Arguments
orderAn integer value specifying the exponent of the Wasserstein distance. Defaults to
1.0.internal_pAn integer value specifying the ground metric on the (upper-half) plane (i.e. the norm \(\ell_p\) in \(R^2\)). Defaults to
Inf.modeA string specifying the method for computing the Wasserstein distance. Choices are either
"pot"or"hera". Defaults to"hera".deltaA numeric value specifying the relative error \(1+\delta\). Defaults to
0.01. Used only ifmode == "hera".n_jobsAn integer value specifying the number of jobs to use for the computation. Defaults to
1L.
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)
dis <- WassersteinDistance$new()
dis$apply(dgm, dgm)
dis$fit_transform(list(dgm))
}