# run this cell to install pycaret in Google Colab
# !pip install pycaret
# If you are using Jupyter notebook, you can pip install pycaret using jupyter notebook or command line
# pip install pycaret
from pycaret.utils import version
version()
from pycaret.datasets import get_data
data = get_data('juice')
from pycaret.classification import *
clf1 = setup(data, target = 'Purchase', session_id=786)
compare_models()
lr = create_model('lr')
dt = create_model('dt')
tuned_dt = tune_model('dt')
tuned_nb = tune_model('nb', optimize = 'AUC')
print(tuned_nb)
bagged_dt = ensemble_model(dt)
boosted_dt = ensemble_model(dt, method = 'Boosting')
lr = create_model('lr', verbose=False)
lda = create_model('lda', verbose=False)
gbc = create_model('gbc', verbose=False)
blender = blend_models(estimator_list=[lr,lda,gbc], method = 'soft')
blender.estimators_
plot_model(blender)
plot_model(blender, plot = 'confusion_matrix')
plot_model(blender, plot = 'threshold')
plot_model(blender, plot = 'pr')
plot_model(tuned_dt, plot = 'vc')
plot_model(dt, plot = 'boundary')
plot_model(tuned_nb, plot = 'boundary')
plot_model(blender, plot = 'boundary')
evaluate_model(tuned_nb)
xgboost = create_model('xgboost')
interpret_model(xgboost)
interpret_model(xgboost, plot = 'correlation')
interpret_model(xgboost, plot = 'reason', observation=1)
interpret_model(xgboost, plot = 'reason')
deploy_model(xgboost, model_name = 'xgboost-for-aws', authentication = {'bucket' : 'pycaret-test'})