# 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('diamond')
from pycaret.regression import *
reg1 = setup(data, target = 'Price', session_id=786)
compare_models(blacklist = ['tr', 'catboost'])
lr = create_model('lr')
plot_model(lr)
plot_model(lr, plot = 'error')
plot_model(lr, plot = 'feature')
# profile = True
data = get_data('diamond', profile = True)
reg2 = setup(data, target = 'Price', session_id=786,
transform_target = True,
bin_numeric_features=['Carat Weight'],
remove_multicollinearity=True,
feature_interaction=True)
lr2 = create_model('lr')
plot_model(lr2)
plot_model(lr2, plot = 'error')
plot_model(lr2, plot = 'feature')
holdout_pred = predict_model(lr2)
final_lr = finalize_model(lr2)
print(final_lr)
save_model(final_lr, 'lr_dataraction_demo')
lr_loaded = load_model('lr_dataraction_demo')
print(lr_loaded)
predictions = predict_model(lr_loaded, data=data)
predictions.head()
deploy_model(final_lr, model_name = 'lr_dataraction', platform = 'aws',
authentication = {'bucket' : 'pycaret-test'})