Uses sampling the fourier transform of the kernel characteristic
at regular intervals.
Since the kernel that is to be approximated is additive, the components of
the input vectors can be treated separately. Each entry in the original
space is transformed into 2*sample_steps-1 features, where sample_steps is
a parameter of the method. Typical values of sample_steps include 1, 2 and
3.
Optimal choices for the sampling interval for certain data ranges can be
computed (see the reference). The default values should be reasonable.
Read more in the .
User Guide
Parameters:
sample_steps : int, default=2
Gives the number of (complex) sampling points.
sample_interval : float, default=None
Sampling interval. Must be specified when sample_steps not in {1,2,3}.
feature_names_in_ : ndarray of shape (n_features_in_,)
Names of features seen during fit. Defined only when X
has feature names that are all strings.
Notes
This estimator approximates a slightly different version of the additive
chi squared kernel then metric.additive_chi2 computes.
This estimator is stateless and does not need to be fitted. However, we
recommend to call fit_transform instead of transform, as
parameter validation is only performed in fit.
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
Estimator instance.
transform(X)
Apply approximate feature map to X.
Parameters:
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Training data, where n_samples is the number of samples
and n_features is the number of features.