GPmix.Smoother

class GPmix.Smoother(basis='bspline', basis_params={}, domain_range=None)[source]

Bases: object

Transform numpy ndarray or skfda.FDataGrid to a smoothed functional data object via smoothing.

Parameters:
  • basis (str, default='bspline') –

    Smoothing basis to use. Supported options are:
    • ’bspline’: B-spline basis smoothing.

    • ’fourier’: Fourier basis smoothing.

    • ’wavelet’: Wavelet basis smoothing.

    • ’nadaraya_watson’: Nadaraya-Watson kernel smoothing.

    • ’knn’: k-nearest neighbors kernel smoothing.

  • basis_params (dict, default={}) –

    Additional parameters for the smoothing basis. If not provided, required parameters are selected via generalized cross-validation (GCV) where implemented. Example parameters:

    • B-spline: {‘order’: 3, ‘n_basis’: 20}

    • Wavelet: {‘wavelet’: ‘db4’, ‘mode’: ‘soft’}

    • Kernel: {‘bandwidth’: 1.0}

    • Fourier: {‘n_basis’: 20, ‘period’: 1}

    For wavelet basis, GCV is not implemented.

  • domain_range (tuple or None, default=None) – The domain range of the functional data. If None, the domain is set to [0, 1] for array-like data, or inherited from the FDataGrid object.

gcv_score

The best GCV score found during parameter selection, if applicable.

Type:

float or None

fd_smooth

The smoothed functional data object.

Type:

skfda.FDataGrid

grid_points

The grid points used for the functional data.

Type:

ndarray

fit(fd, return_data=True)[source]

Fit the transformation to the input array.

Parameters:
  • fd (array-like or skfda.FDataGrid object) – The input data to transform.

  • Returns – FDataGrid: The transformed functional data.