user_logging_tests.py 文件源码

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

项目:auto_ml 作者: doordash 项目源码 文件源码
def test_throws_warning_when_fl_data_equals_df_train():
    df_titanic_train, df_titanic_test = utils.get_titanic_binary_classification_dataset()

    column_descriptions = {
        'survived': 'output'
        , 'embarked': 'categorical'
        , 'pclass': 'categorical'
    }

    ml_predictor = Predictor(type_of_estimator='classifier', column_descriptions=column_descriptions)

    with warnings.catch_warnings(record=True) as w:

        try:
            ml_predictor.train(df_titanic_train, feature_learning=True, fl_data=df_titanic_train)
        except KeyError as e:
            pass
    # We should not be getting to this line- we should be throwing an error above
        for thing in w:
            print(thing)
        assert len(w) == 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号