test_rfr_with_instances.py 文件源码

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

项目:SMAC3 作者: automl 项目源码 文件源码
def test_predict(self):
        rs = np.random.RandomState(1)
        X = rs.rand(20, 10)
        Y = rs.rand(10, 1)
        model = RandomForestWithInstances(np.zeros((10,), dtype=np.uint), bounds=np.array(
                list(map(lambda x: (0, 10), range(10))), dtype=object))
        model.train(X[:10], Y[:10])
        m_hat, v_hat = model.predict(X[10:])
        self.assertEqual(m_hat.shape, (10, 1))
        self.assertEqual(v_hat.shape, (10, 1))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号