gudhi.representations.vector_methods.Landscape Class Reference

Public Member Functions

def __init__ (self, num_landscapes=5, 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 landscapes from a list of persistence diagrams. A persistence landscape is a collection of 1D piecewise-linear functions computed from the rank function associated to the persistence diagram. These piecewise-linear functions are then sampled evenly on a given range and the corresponding vectors of samples are concatenated and returned. See http://jmlr.org/papers/v16/bubenik15a.html for more details.

Constructor & Destructor Documentation

◆ __init__()

def gudhi.representations.vector_methods.Landscape.__init__ (   self,
  num_landscapes = 5,
  resolution = 100,
  sample_range = [np.nan, np.nan] 
)
Constructor for the Landscape class.

Parameters:
    num_landscapes (int): number of piecewise-linear functions to output (default 5).
    resolution (int): number of sample for all piecewise-linear functions (default 100).
    sample_range ([double, double]): minimum and maximum of all piecewise-linear function domains, 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.Landscape.__call__ (   self,
  diag 
)
Apply Landscape on a single persistence diagram and outputs the result.

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

Returns:
    numpy array with shape (number of samples = **num_landscapes** x **resolution**): output persistence landscape.

◆ fit()

def gudhi.representations.vector_methods.Landscape.fit (   self,
  X,
  y = None 
)
Fit the Landscape 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.Landscape.transform (   self,
  X 
)
Compute the persistence landscape 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 (number of samples = **num_landscapes** x **resolution**): output persistence landscapes.

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