- sklearn.metrics.pairwise.additive_chi2_kernel(X, Y=None)¶
Computes the additive chi-squared kernel between observations in 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) = -∑ᵢ [(xᵢ - yᵢ)² / (xᵢ + yᵢ)]
It can be interpreted as a weighted difference per entry.
X : array-like of shape (n_samples_X, n_features)
Y : array of shape (n_samples_Y, n_features)
kernel_matrix : array of shape (n_samples_X, n_samples_Y)
As the negative of a distance, this kernel is only conditionally positive definite.
- Zhang, J. and Marszalek, M. and Lazebnik, S. and Schmid, C. Local features and kernels for classification of texture and object categories: A comprehensive study International Journal of Computer Vision 2007 http://eprints.pascal-network.org/archive/00002309/01/Zhang06-IJCV.pdf