核函数 多项式核函数 高斯核函数(常用)
import numpy as npimport matplotlib.pyplot as pltdef gaussian(x,l): gama=1.0 return np.exp(-gama*(x-l)**2)x=np.arange(-4,5,1)print(x)y=np.array((x>=-2)&(x<=2),dtype="int")print(y)l1,l2=-1,1x_new=np.empty((len(x),