TransformerResamplerMixin

class gtda.base.TransformerResamplerMixin[source]

Mixin class for all transformers-resamplers in giotto-tda.

__init__()

Initialize self. See help(type(self)) for accurate signature.

fit_transform(X, y=None, **fit_params)[source]

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
  • X (ndarray of shape (n_samples, ..)) – Input data.

  • y (None) – There is no need for a target in a transformer, yet the pipeline API requires this parameter.

Returns

Xt – Transformed input.

Return type

numpy array of shape (n_samples, ..)

fit_transform_resample(X, y, **fit_params)[source]

Fit to data, then transform the input and resample the target. Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X ans a resampled version of y.

Parameters
  • X (ndarray of shape (n_samples, ..)) – Input data.

  • y (ndarray of shape (n_samples,)) – Target data.

Returns

  • Xt (ndarray of shape (n_samples, …)) – Transformed input.

  • yr (ndarray of shape (n_samples, …)) – Resampled target.

transform_resample(X, y)[source]

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
  • X (ndarray of shape (n_samples, ..)) – Input data.

  • y (ndarray of shape (n_samples,)) – Target data.

Returns

  • Xt (ndarray of shape (n_samples, …)) – Transformed input.

  • yr (ndarray of shape (n_samples, …)) – Resampled target.