Implement a linear kernel function for support vector machines. The linear kernel computes the dot product between two input vectors.
import numpy as np
def linear_kernel(x1, x2):
x1 = np.array(x1, dtype=np.float64)
x2 = np.array(x2, dtype=np.float64)
return float(np.dot(x1, x2))np.dot.K(x1, x2) = x1 . x2 measures similarity as the inner product in the original feature space.