NadarayaWatsonHatMatrix#
- class skfda.misc.hat_matrix.NadarayaWatsonHatMatrix(*, bandwidth=None, kernel=<function normal>)[source]#
Nadaraya-Watson method.
Creates the matrix \(\hat{H}\), used in the kernel smoothing and kernel regression algorithms, as explained below
\[\hat{H}_{i,j} = \frac{K\left(\frac{d(x_j-x_i')}{h}\right)}{\sum_{k=1}^{ n}K\left(\frac{d(x_k-x_i')}{h}\right)}\]For smoothing, \(\{x_1, ..., x_n\}\) are the points with known value and \(\{x_1', ..., x_m'\}\) are the points for which it is desired to estimate the smoothed value. The distance \(d\) is the absolute value function [1].
For regression, \(\{x_1, ..., x_n\}\) is the functional data and \(\{x_1', ..., x_m'\}\) are the functions for which it is desired to estimate the scalar value. Here, \(d\) is some functional distance [2].
In both cases \(K(\cdot)\) is a kernel function and \(h\) is the bandwidth.
- Parameters:
bandwidth (float | None) – Window width of the kernel (also called h or bandwidth).
kernel (Callable[[NDArrayFloat], NDArrayFloat]) – Kernel function. By default a normal kernel.
References
Methods
Get metadata routing of this object.
get_params
([deep])Get parameters for this estimator.
set_params
(**params)Set the parameters of this estimator.
- get_metadata_routing()#
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:
routing – A
MetadataRequest
encapsulating routing information.- Return type:
MetadataRequest
- get_params(deep=True)#
Get parameters for this estimator.
- set_params(**params)#
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline
). The latter have parameters of the form<component>__<parameter>
so that it’s possible to update each component of a nested object.- Parameters:
**params (dict) – Estimator parameters.
- Returns:
self – Estimator instance.
- Return type:
estimator instance
Examples using skfda.misc.hat_matrix.NadarayaWatsonHatMatrix
#
Voice signals: smoothing, registration, and classification