giotto.diagrams
.ForgetDimension¶
-
class
giotto.diagrams.
ForgetDimension
¶ Replaces all homology dimensions in persistence diagrams with
numpy.inf
.Useful when downstream tasks require using topological features all at once – and not separated between different homology dimensions.
Methods
fit
(self, X[, y])Do nothing and return the estimator unchanged.
fit_transform
(self, X[, y])Fit to data, then transform it.
get_params
(self[, deep])Get parameters for this estimator.
set_params
(self, \*\*params)Set the parameters of this estimator.
transform
(self, X[, y])Replace all homology dimensions in X with
numpy.inf
.-
__init__
(self)¶ Initialize self. See help(type(self)) for accurate signature.
-
fit
(self, X, y=None)¶ Do nothing and return the estimator unchanged.
This method is there to implement the usual scikit-learn API and hence work in pipelines.
- Parameters
- Xndarray, shape (n_samples, n_features, 3)
Input data. Array of persistence diagrams, each a collection of triples [b, d, q] representing persistent topological features through their birth (b), death (d) and homology dimension (q).
- yNone
There is no need for a target in a transformer, yet the pipeline API requires this parameter.
- Returns
- selfobject
-
fit_transform
(self, X, y=None, **fit_params)¶ Fit to data, then transform it.
Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.
- Parameters
- Xnumpy array of shape [n_samples, n_features]
Training set.
- ynumpy array of shape [n_samples]
Target values.
- Returns
- X_newnumpy array of shape [n_samples, n_features_new]
Transformed array.
-
get_params
(self, deep=True)¶ Get parameters for this estimator.
- Parameters
- deepboolean, optional
If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Returns
- paramsmapping of string to any
Parameter names mapped to their values.
-
set_params
(self, **params)¶ Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form
<component>__<parameter>
so that it’s possible to update each component of a nested object.- Returns
- self
-
transform
(self, X, y=None)¶ Replace all homology dimensions in X with
numpy.inf
.- Parameters
- Xndarray, shape (n_samples, n_features, 3)
Input data. Array of persistence diagrams, each a collection of triples [b, d, q] representing persistent topological features through their birth (b), death (d) and homology dimension (q).
- yNone
There is no need for a target in a transformer, yet the pipeline API requires this parameter.
- Returns
- Xtndarray, shape (n_samples, n_features, 3)
Output persistence diagram.
-