sklearn.metrics.pairwise.chi2_kernel(X, Y=None, gamma=1.0)
[source]
Computes the exponential chi-squared kernel X and Y.
The chi-squared kernel is computed between each pair of rows in X and Y. X and Y have to be non-negative. This kernel is most commonly applied to histograms.
The chi-squared kernel is given by:
k(x, y) = exp(-gamma Sum [(x - y)^2 / (x + y)])
It can be interpreted as a weighted difference per entry.
Read more in the User Guide.
Parameters: |
|
---|---|
Returns: |
|
See also
additive_chi2_kernel
sklearn.kernel_approximation.AdditiveChi2Sampler
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.chi2_kernel.html