This is a class for preprocessing persistence diagrams with a given list of scalers, such as those included in scikit-learn.
◆ __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).
◆ __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:
- src/python/gudhi/representations/preprocessing.py