gudhi.representations.preprocessing.DiagramScaler Class Reference

Public Member Functions

def __init__ (self, use=False, scalers=[])
 
def fit (self, X, y=None)
 
def transform (self, X)
 
def __call__ (self, diag)
 

Detailed Description

This is a class for preprocessing persistence diagrams with a given list of scalers, such as those included in scikit-learn.

Constructor & Destructor Documentation

◆ __init__()

def gudhi.representations.preprocessing.DiagramScaler.__init__ (   self,
  use = False,
  scalers = [] 
)
Constructor for the DiagramScaler class.

Parameters:
    use (bool): whether to use the class or not (default False).
    scalers (list of classes): list of scalers to be fit on the persistence diagrams (default []). Each element of the list is a tuple with two elements: the first one is a list of coordinates, and the second one is a scaler (i.e. a class with fit() and transform() methods) that is going to be applied to these coordinates. Common scalers can be found in the scikit-learn library (such as MinMaxScaler for instance).

Member Function Documentation

◆ __call__()

def gudhi.representations.preprocessing.DiagramScaler.__call__ (   self,
  diag 
)
Apply DiagramScaler 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: transformed persistence diagram.

◆ fit()

def gudhi.representations.preprocessing.DiagramScaler.fit (   self,
  X,
  y = None 
)
Fit the DiagramScaler class on a list of persistence diagrams: persistence diagrams are concatenated in a big numpy array, and scalers are fit (by calling their fit() method) on their corresponding coordinates in this big array.

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.DiagramScaler.transform (   self,
  X 
)
Apply the DiagramScaler function on the persistence diagrams. The fitted scalers are applied (by calling their transform() method) to their corresponding coordinates in 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: transformed 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