题解|线性核函数
线性核函数
https://www.nowcoder.com/practice/cb6ea219dc23469fbdcbf55573937c72?tpId=377&tags=&title=&difficulty=&judgeStatus=&rp=0&sourceUrl=%2Fexam%2Foj&gioEnter=menu
线性核函数(Linear Kernel)是一种常用的核函数,其计算公式为:
其中,和
是两个向量。
该算法的本质是计算两个向量的内积。
标准代码如下
def kernel_function(x1, x2):
return np.inner(x1, x2)
