gudhi.representations.preprocessing.ProminentPoints Class Reference

Public Member Functions

def __init__ (self, use=False, num_pts=10, threshold=-1, location="upper")
 
def fit (self, X, y=None)
 
def transform (self, X)
 
def __call__ (self, diag)
 

Detailed Description

This is a class for removing points that are close or far from the diagonal in persistence diagrams.  If persistence diagrams are n x 2 numpy arrays (i.e. persistence diagrams with ordinary features), points are ordered and thresholded by distance-to-diagonal. If persistence diagrams are n x 1 numpy arrays (i.e. persistence diagrams with essential features), points are not ordered and thresholded by first coordinate.

Constructor & Destructor Documentation

◆ __init__()

def gudhi.representations.preprocessing.ProminentPoints.__init__ (   self,
  use = False,
  num_pts = 10,
  threshold = -1,
  location = "upper" 
)
Constructor for the ProminentPoints class.
     
Parameters:
    use (bool): whether to use the class or not (default False).
    location (string): either "upper" or "lower" (default "upper"). Whether to keep the points that are far away ("upper") or close ("lower") to the diagonal.
    num_pts (int): cardinality threshold (default 10). If location == "upper", keep the top **num_pts** points that are the farthest away from the diagonal. If location == "lower", keep the top **num_pts** points that are the closest to the diagonal. 
    threshold (double): distance-to-diagonal threshold (default -1). If location == "upper", keep the points that are at least at a distance **threshold** from the diagonal. If location == "lower", keep the points that are at most at a distance **threshold** from the diagonal. 

Member Function Documentation

◆ __call__()

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

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

Returns:
    n x 2 numpy array: thresholded persistence diagram.

◆ fit()

def gudhi.representations.preprocessing.ProminentPoints.fit (   self,
  X,
  y = None 
)
Fit the ProminentPoints class on a list of persistence diagrams (this function actually does nothing but is useful when ProminentPoints is included in a scikit-learn Pipeline).

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

◆ transform()

def gudhi.representations.preprocessing.ProminentPoints.transform (   self,
  X 
)
If location == "upper", first select the top **num_pts** points that are the farthest away from the diagonal, then select and return from these points the ones that are at least at distance **threshold** from the diagonal for each persistence diagram individually. If location == "lower", first select the top **num_pts** points that are the closest to the diagonal, then select and return from these points the ones that are at most at distance **threshold** from the diagonal for each persistence diagram individually.

Parameters:
    X (list of n x 2 or n x 1 numpy arrays): input persistence diagrams.

Returns:
    list of n x 2 or n x 1 numpy arrays: thresholded persistence diagrams.

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