0

如果我尝试执行:

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 版本是 2.3.4,按照 Pycaret 文档中的建议安装在新的专用 conda 环境中。

4

1 回答 1

0

终于解决了!!

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-10-12T17:11:16.547 回答