sklearn.metrics.pairwise.polynomial_kernel?
sklearn.metrics.pairwise.polynomial_kernel(X, Y=None, degree=3, gamma=None, coef0=1)
計算X和Y之間的多項式內核:
K(X, Y) = (gamma <X, Y> + coef0)^degree
在用戶指南中閱讀更多內容。
參數 | 說明 |
---|---|
X | ndarray of shape (n_samples_1, n_features) |
Y | ndarray of shape (n_samples_2, n_features) |
degree | int, default 3 |
gamma | float, default None 如果為None,則默認為1.0 / n_features |
coef0 | float, default 1 |
返回值 | 說明 |
---|---|
Gram matrix | array of shape (n_samples_1, n_samples_2) |