Public Member Functions | |
def | __init__ (self, bandwidth=1., weight=lambda x:1, kernel_approx=None, n_jobs=None) |
def | fit (self, X, y=None) |
def | transform (self, X) |
def | __call__ (self, diag1, diag2) |
This is a class for computing 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.
def gudhi.representations.kernel_methods.PersistenceWeightedGaussianKernel.__init__ | ( | self, | |
bandwidth = 1. , |
|||
weight = lambda x: 1 , |
|||
kernel_approx = None , |
|||
n_jobs = None |
|||
) |
Constructor for the PersistenceWeightedGaussianKernel class. Parameters: bandwidth (double): bandwidth of the Gaussian kernel with which persistence diagrams will be convolved (default 1.) weight (function): weight function for the persistence diagram points (default constant function, ie lambda x: 1). This function must be defined on 2D points, ie lists or numpy arrays of the form [p_x,p_y]. kernel_approx (class): kernel approximation class used to speed up computation (default None). Common kernel approximations classes can be found in the scikit-learn library (such as RBFSampler for instance). n_jobs (int): number of jobs to use for the computation. See :func:`pairwise_persistence_diagram_kernels` for details.
def gudhi.representations.kernel_methods.PersistenceWeightedGaussianKernel.__call__ | ( | self, | |
diag1, | |||
diag2 | |||
) |
Apply PersistenceWeightedGaussianKernel on a single pair of persistence diagrams and outputs the result. Parameters: diag1 (n x 2 numpy array): first input persistence diagram. diag2 (n x 2 numpy array): second input persistence diagram. Returns: float: persistence weighted Gaussian kernel value.
def gudhi.representations.kernel_methods.PersistenceWeightedGaussianKernel.fit | ( | self, | |
X, | |||
y = None |
|||
) |
Fit the PersistenceWeightedGaussianKernel class on a list of persistence diagrams: persistence diagrams are stored in a numpy array called **diagrams** and the kernel approximation class (if not None) is applied on them. Parameters: X (list of n x 2 numpy arrays): input persistence diagrams. y (n x 1 array): persistence diagram labels (unused).
def gudhi.representations.kernel_methods.PersistenceWeightedGaussianKernel.transform | ( | self, | |
X | |||
) |
Compute all persistence weighted Gaussian kernel values between the persistence diagrams that were stored after calling the fit() method, and a given list of (possibly different) persistence diagrams. Parameters: X (list of n x 2 numpy arrays): input persistence diagrams. Returns: numpy array of shape (number of diagrams in **diagrams**) x (number of diagrams in X): matrix of pairwise persistence weighted Gaussian kernel values.
GUDHI Version 3.3.0 - C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding. - Copyright : MIT | Generated on Tue Aug 11 2020 11:58:59 for GUDHI by Doxygen 1.8.18 |