Created
August 1, 2020 01:02
-
-
Save pycaret/d2b5da299cfe518c22f06aeb754f73bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import classification module | |
from pycaret.classification import * | |
# init setup | |
clf1 = setup(data, target = 'name-of-target') | |
# return best model | |
best = compare_models() | |
# return best model based on Recall | |
best = compare_models(sort = 'Recall') #default is 'Accuracy' | |
# compare specific models | |
best_specific = compare_models(whitelist = ['dt','rf','xgboost']) | |
# blacklist certain models | |
best_specific = compare_models(blacklist = ['catboost','svm']) | |
# return top 3 models based on Accuracy | |
top3 = compare_models(n_select = 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to show the output of compare_models() in a streamlit page. I can get the scoring metric/Scoring Grid in jupyter notebook but when same code in pasted in streamlit, I can only get best model & its detailed params. How to get the scoring GRID in code?