题解|线性核函数

线性核函数

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)
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务