LinearSmootherGeneralizedCVScorer#

class skfda.preprocessing.smoothing.validation.LinearSmootherGeneralizedCVScorer(penalization_function=None)[source]#

Generalized cross validation scoring method for linear smoothers.

It calculates the general cross validation score for every sample in a FDataGrid object given a smoothing matrix \(\mathbf{S}(h)\) calculated with a parameter \(h\):

\[GCV(h)=\Xi(\mathbf{S}(h))\frac{1}{M} \sum_{m=1}^{M} \left(x(t_m) - \hat{x}(t_m; h)\right)^2,\]

Where \(\hat{x}(t_m; h)\) is the adjusted \(x(t_m)\) and \(\Xi\) is a penalization function. By default the penalization function is:

\[\Xi(\mathbf{S}(h)) = \frac{1}{(1 - \text{tr}(\mathbf{S}(h))/M)^2}.\]

but others such as the Akaike’s information criterion can be considered.

Parameters:
  • estimator (Estimator) – Linear smoothing estimator.

  • X (FDataGrid) – Functional data to smooth.

  • y (FDataGrid) – Functional data target. Should be the same as X.

  • penalization_function (Callable[[NDArrayFloat], float] | None) –

Returns:

Cross validation score, with negative sign, as it is a penalization.

Return type:

float

Methods

Examples using skfda.preprocessing.smoothing.validation.LinearSmootherGeneralizedCVScorer#

Kernel Smoothing

Kernel Smoothing