test_model_selection.py 文件源码

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

项目:mlens 作者: flennerhag 项目源码 文件源码
def test_passes():
    """[Model Selection] Test sets error score on failed scoring."""

    evl = Evaluator(bad_scorer, error_score=0, n_jobs=1, verbose=5)

    with open(os.devnull, 'w') as f, redirect_stdout(f):
        evl = np.testing.assert_warns(FitFailedWarning,
                                      evl.fit, X, y,
                                      estimators=[OLS()],
                                      param_dicts={'ols':
                                                   {'offset': randint(1, 10)}},
                                      n_iter=1)
    assert evl.results['test_score-m']['ols'] == 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号