sklearn.metrics.pairwise.laplacian_kernel?
sklearn.metrics.pairwise.laplacian_kernel(X, Y=None, gamma=None)
計算X和Y之間的拉普拉斯核。
拉普拉斯內核定義為:
K(x, y) = exp(-gamma ||x-y||_1)
對于每對X中的行x和Y中的y。請閱讀用戶指南。
版本0.17中的新功能。
參數 | 說明 |
---|---|
X | array of shape (n_samples_X, n_features) |
Y | array of shape (n_samples_Y, n_features) |
gamma | float, default None 如果為None,則默認為1.0 / n_features |
返回值 | 說明 |
---|---|
kernel_matrix | array of shape (n_samples_X, n_samples_Y) |