pycaret 是一个非常紧凑的工具,用于比较我想用于模型选择的模型。不幸的是,compare_models 方法没有显示您随处可见的典型输出表。我在 PyCharm 中使用 pycaret 而不是 Jupyter Notebook,这似乎是典型的方法。我确实得到了最好的模型作为返回值,但我的目标是概览表。silent
是否将参数设置为True
或False
要求确认派生数据类型是否正确似乎也没有区别。
非常感谢你!
系统: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 Notebook 中按预期工作