Skip to content

Instantly share code, notes, and snippets.

@pycaret
Created August 1, 2020 01:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pycaret/d2b5da299cfe518c22f06aeb754f73bd to your computer and use it in GitHub Desktop.
Save pycaret/d2b5da299cfe518c22f06aeb754f73bd to your computer and use it in GitHub Desktop.
# 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)
@THESHAMIK
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment