Linear kernel gives straight boundaries, and RBF kernel gives bumpy ones driven by distance. A polynomial kernel sits between them: it raises a shifted, scaled dot product to a power, so the boundary can bend in controlled, polynomial ways. Degree 1 is the linear kernel again, and higher degrees allow more curvature.
Given X with shape (n, d) and Y with shape (m, d), return the (n, m) matrix of polynomial similarities.
(n, m) where entry [i, j] equals (gamma * X[i] @ Y[j] + coef0) ** degree.degree=3, coef0=1.0, gamma=1.0.linear_kernel from the previous question, which is already available to load.X or Y.Open one at a time. Each gives away a little more than the last.
Call linear_kernel(X, Y) for the dot products, then scale, shift, and raise to a power, all elementwise.
Scale before you shift: gamma * dots + coef0, not gamma * (dots + coef0).
No results yet
Run your code to check it against the examples, or submit to run every test.