test_svd.py 文件源码

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

项目:dask-ml 作者: dask 项目源码 文件源码
def test_inverse_transform():
    # We need a lot of components for the reconstruction to be "almost
    # equal" in all positions. XXX Test means or sums instead?
    a = dd.TruncatedSVD(n_components=52, random_state=42, n_iter=5)
    b = sd.TruncatedSVD(n_components=52, random_state=42)
    b.fit(Xdense)
    Xt = a.fit_transform(dXdense)
    Xinv = a.inverse_transform(Xt)
    assert_array_almost_equal(Xinv.compute(), Xdense, decimal=1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号