This notebook is created using PyCaret 2.0. Last updated : 28-07-2020
# check version
from pycaret.utils import version
version()
from pycaret.datasets import get_data
data = get_data('public_health')
from pycaret.clustering import *
clu1 = setup(data, ignore_features = ['Country Name'], session_id=123, log_experiment=True, log_plots = True, experiment_name='health1')
models()
kmeans = create_model('kmeans', num_clusters = 4)
kmodes = create_model('kmodes', num_clusters = 4)
kmeans_results = assign_model(kmeans)
kmeans_results.head()
plot_model(kmeans)
plot_model(kmeans, feature = 'Country Name', label=True)
plot_model(kmeans, plot = 'tsne')
plot_model(kmeans, plot = 'elbow')
plot_model(kmeans, plot = 'silhouette')
plot_model(kmeans, plot = 'distance')
plot_model(kmeans, plot = 'distribution')
pred_new = predict_model(kmeans, data=data)
pred_new.head()
save_model(kmeans, model_name='kmeans')
loaded_kmeans = load_model('kmeans')
print(loaded_kmeans)
from sklearn import set_config
set_config(display='diagram')
loaded_kmeans[0]
from sklearn import set_config
set_config(display='text')
deploy_model(kmeans, model_name = 'kmeans-aws', authentication = {'bucket' : 'pycaret-test'})
X = get_config('X')
X.head()
get_config('seed')
from pycaret.clustering import set_config
set_config('seed', 999)
get_config('seed')
get_system_logs()
!mlflow ui
Thank you. For more information / tutorials on PyCaret, please visit https://www.pycaret.org