Python 3.x Pycaret.regression.compare_模型:既不返回也不显示评估表
pycaret是一个非常紧凑的工具,用于比较我希望用于模型选择的模型。不幸的是,compare_模型的方法并没有显示您在任何地方都能看到的典型情况。我在PyCharm中使用pycaret,而不是Jupyter笔记本,这似乎是典型的方法。我确实得到了最好的模型作为返回值,但我的目标是概览表。参数Python 3.x Pycaret.regression.compare_模型:既不返回也不显示评估表,python-3.x,pycaret,Python 3.x,Pycaret,pycaret是一个非常紧凑的工具,用于比较我希望用于模型选择的模型。不幸的是,compare_模型的方法并没有显示您在任何地方都能看到的典型情况。我在PyCharm中使用pycaret,而不是Jupyter笔记本,这似乎是典型的方法。我确实得到了最好的模型作为返回值,但我的目标是概览表。参数silent是否设置为True或Falseappart与要求确认派生的数据类型是否正确似乎没有什么区别 多谢各位 系统: Python 3.6 pycaret 2.3 CentOS 7 PyCharm 20
silent
是否设置为True
或False
appart与要求确认派生的数据类型是否正确似乎没有什么区别
多谢各位
系统:
Python 3.6
pycaret 2.3
CentOS 7
PyCharm 2020.1社区版
我的代码:
regression.setup(data=ml_df,
target='occupation',
n_jobs=6,
categorical_features=['cluster', 'vacation', 'long_weekend', 'month', 'hour', 'weekday'],
numeric_features=['temperature', 'precipitation'],
silent=False
)
best_regression_models = regression.compare_models()
categorisation = [
[-0.1, 'empty'],
[0.01, 'partial'],
[0.99, 'full']
]
ml_df['occupation'] = modelling_utils.convert_number_to_categorical(ml_df['occupation'], categorisation)
classification.setup(data=ml_df,
target='occupation',
n_jobs=6,
categorical_features=['cluster', 'vacation', 'long_weekend', 'month', 'hour', 'weekday'],
numeric_features=['temperature', 'precipitation'],
fix_imbalance=True,
silent=False)
best_classification_models = classification.compare_models()
完整的输出有点冗长和节省
编辑:代码在Jupyter笔记本中按预期工作从终端/命令行运行PyCaret与从Jupyter笔记本运行有不同的行为。在本例中,如果要显示比较输出表,请在compare_models()函数调用后添加以下两行:
..
best_regression_models = regression.compare_models()
regression_results = pull()
print(regression_results)
pull()函数还将与其他训练函数(如create_model())一起返回最后的分数网格。目前,此功能仅适用于回归和分类模块
参考: