This is documentation for an old release of Scikit-learn (version 0.17). Try the latest stable release (version 1.6) or development (unstable) versions.

sklearn.metrics.pairwise.linear_kernel

sklearn.metrics.pairwise.linear_kernel(X, Y=None)[source]

Compute the linear kernel between X and Y.

Read more in the User Guide.

Parameters:

X : array of shape (n_samples_1, n_features)

Y : array of shape (n_samples_2, n_features)

Returns:

Gram matrix : array of shape (n_samples_1, n_samples_2)