Kernel Representation: Persistence Weighted Gaussian Kernel
Source:R/representation-kernel-methods.R
PersistenceWeightedGaussianKernel.Rd
Computes the persistence weighted Gaussian kernel matrix from a list of persistence diagrams. The persistence weighted Gaussian kernel is computed by convolving the persistence diagram points with weighted Gaussian kernels. See http://proceedings.mlr.press/v48/kusano16.html for more details.
Super classes
rgudhi::PythonClass
-> rgudhi::SKLearnClass
-> rgudhi::KernelRepresentationStep
-> PersistenceWeightedGaussianKernel
Methods
Inherited methods
rgudhi::PythonClass$get_python_class()
rgudhi::PythonClass$set_python_class()
rgudhi::SKLearnClass$get_params()
rgudhi::SKLearnClass$set_params()
rgudhi::KernelRepresentationStep$apply()
rgudhi::KernelRepresentationStep$fit()
rgudhi::KernelRepresentationStep$fit_transform()
rgudhi::KernelRepresentationStep$transform()
Method new()
The PersistenceWeightedGaussianKernel
constructor.
Usage
PersistenceWeightedGaussianKernel$new(
bandwidth = 1,
weight = ~1,
kernel_approx = NULL,
n_jobs = 1
)
Arguments
bandwidth
A numeric value specifying the bandwidth of the Gaussian kernel with which persistence diagrams will be convolved. Defaults to
1.0
.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]\).kernel_approx
A Python class specifying the kernel approximation class used to speed up computation. Defaults to
NULL
. Common kernel approximations classes can be found in the scikit-learn library (such asRBFSampler
for instance).n_jobs
An integer value specifying the number of jobs to use for the computation. Defaults to
1
.
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)
pwgk <- PersistenceWeightedGaussianKernel$new()
pwgk$apply(dgm, dgm)
pwgk$fit_transform(list(dgm))
}