pycaret is a very compact tool to compare models that I wanted to use for model selection. Unfortunately, the method compare_models does not show the typical output table that you see everywhere. I am using pycaret in PyCharm and not Jupyter Notebook which seems to be the typical approach. I do get the best model as a return value, but am really aiming for the overview table. It also doesn't seem to make a difference whether the parameter silent
is set to True
or False
appart from being asked for the confirmation of whether the derived datatypes are correct.
Thank you very much!
The system: Python 3.6 pycaret 2.3 CentOS 7 PyCharm 2020.1 Community Edition
My code:
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()
The full output is somewhat lengthy and saved here.
Edit: The code works as expected in a Jupyter Notebook
Running PyCaret from a terminal/command line has different behavior compared to running from a Jupyter notebook. In your case, if you want to display the comparison output table, add these 2 lines after your compare_models() function call:
..
best_regression_models = regression.compare_models()
regression_results = pull()
print(regression_results)
The pull() function will also return the last score grid with other training functions, such as create_model(). Currently this function only works with the regression and classification modules.
Reference: https://pycaret.org/pull/
UPDATED References: