hoag_kernel.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:hoag 作者: OuYag 项目源码 文件源码
def fit(self, Xt, yt):
        self.Xt = Xt
        x0 = np.zeros(Xt.shape[0])

        # returns an approximate solution of the inner optimization
        K = pairwise_kernels(Xt, gamma=np.exp(self.alpha0[0]), metric='rbf')
        (out, success) = splinalg.cg(
            K + np.exp(self.alpha0[1]) * np.eye(x0.size), yt, x0=x0)
        if success is False:
            raise ValueError
        self.dual_coef_ = out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号