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) |