【问题标题】:Pycaret models() method throw NameErrorPycaret models() 方法抛出 NameError
【发布时间】:2021-10-08 06:38:50
【问题描述】:

如果我尝试执行:

from pycaret.regression import *
models()

我收到以下错误:

Traceback (most recent call last):
File "", line 1, in
File "/home/user/.local/lib/python3.8/site-packages/pycaret/regression.py", line 2088, in models
return pycaret.internal.tabular.models(
File "/home/user/.local/lib/python3.8/site-packages/pycaret/internal/tabular.py", line 9494, in models
logger.info(f"gpu_param set to {gpu_param}")
NameError: name 'logger' is not defined

目前无法修复.... 根据 Pycaret 文档的建议,Pycaret 版本是 2.3.4,安装在新的专用 conda 环境中。

【问题讨论】:

    标签: python pycaret


    【解决方案1】:

    终于解决了!!

    model()
    

    只有在定义了设置后才需要调用。
    以下代码按预期工作:

    reg = setup(df_work,
                target='CO',
                session_id=123,
                log_experiment=True,
                experiment_name=station,
                fold_strategy=TSSplit(train_size=30*24*7, n_splits=3),
                verbose=False,
                silent=True
                )
    models()
    

    【讨论】:

      猜你喜欢
      • 2021-08-07
      • 2019-10-31
      • 2015-11-04
      • 1970-01-01
      • 1970-01-01
      • 2021-08-01
      • 2019-09-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多