gudhi.representations.vector_methods.Silhouette Class Reference

Public Member Functions

def __init__ (self, weight=lambda x:1, resolution=100, sample_range=[np.nan, np.nan])
 
def fit (self, X, y=None)
 
def transform (self, X)
 
def __call__ (self, diag)
 

Detailed Description

This is a class for computing persistence silhouettes from a list of persistence diagrams. A persistence silhouette is computed by taking a weighted average of the collection of 1D piecewise-linear functions given by the persistence landscapes, and then by evenly sampling this average on a given range. Finally, the corresponding vector of samples is returned. See https://arxiv.org/abs/1312.0308 for more details.

Constructor & Destructor Documentation

◆ __init__()

def gudhi.representations.vector_methods.Silhouette.__init__ (   self,
  weight = lambda x: 1,
  resolution = 100,
  sample_range = [np.nan, np.nan] 
)
Constructor for the Silhouette class.

Parameters:
    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 on lists or numpy arrays of the form [p_x,p_y].
    resolution (int): number of samples for the weighted average (default 100).
    sample_range ([double, double]): minimum and maximum for the weighted average domain, of the form [x_min, x_max] (default [numpy.nan, numpy.nan]). It is the interval on which samples will be drawn evenly. If one of the values is numpy.nan, it can be computed from the persistence diagrams with the fit() method.

Member Function Documentation

◆ __call__()

def gudhi.representations.vector_methods.Silhouette.__call__ (   self,
  diag 
)
Apply Silhouette on a single persistence diagram and outputs the result.

Parameters:
    diag (n x 2 numpy array): input persistence diagram.

Returns:
    numpy array with shape (**resolution**): output persistence silhouette.

◆ fit()

def gudhi.representations.vector_methods.Silhouette.fit (   self,
  X,
  y = None 
)
Fit the Silhouette class on a list of persistence diagrams: if any of the values in **sample_range** is numpy.nan, replace it with the corresponding value computed on the given list of persistence diagrams.

Parameters:
    X (list of n x 2 numpy arrays): input persistence diagrams.
    y (n x 1 array): persistence diagram labels (unused).

◆ transform()

def gudhi.representations.vector_methods.Silhouette.transform (   self,
  X 
)
Compute the persistence silhouette for each persistence diagram individually and concatenate the results.

Parameters:
    X (list of n x 2 numpy arrays): input persistence diagrams.
    
Returns:
    numpy array with shape (number of diagrams) x (**resolution**): output persistence silhouettes.

The documentation for this class was generated from the following file:
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