predict model and deploy model function in clustering in pycaret

This recipe explains the predict model and deploy model function in clustering in pycaret. The Predict model function predicts

Recipe Objective - What are the predict_model and deploy_model functions in the clustering model in pycaret?

PyCaret provides predict_model and deploy_model functions in the clustering module.

Explore the Real-World Applications of Recommender Systems

For more related projects:-

https://www.projectpro.io/projects/data-science-projects/data-science-projects-in-python
https://www.projectpro.io/projects/data-science-projects/machine-learning-projects-in-python

Predict Model function with Example:-

PyCaret provides "pycaret.clustering.predict_model()" function. The Predict model function predicts "Label" and "Score" using a trained model.

from pycaret.datasets import get_data
jewll = get_data('jewellery')
# importing clustering module
from pycaret.clustering import *
# initialize the setup
setup_name = setup(data = jewll)
# k_means clustering
k_m = create_model('kmeans')
pred = predict_model(k_m)
pred

deploy_model function with Example:-

PyCaret provides "pycaret.clustering.deploy_model()" function. The Deploy model function deploys the transformation pipeline and trained model on cloud.

from pycaret.datasets import get_data
jewll = get_data('jewellery')
# importing clustering module
from pycaret.clustering import *
# initialize the setup
setup_name = setup(data = jewll)
# k_means clustering
k_m = create_model('kmeans')
# sets appropriate credentials for the platform as environment variables
import os
# set your cloud ACCESS_KEY_ID, SECRET_ACCESS_KEY
os.environ["AWS_ACCESS_KEY_ID"] = str("foo")
os.environ["AWS_SECRET_ACCESS_KEY"] = str("bar")
deploy_model(model = lr, model_name = 'lr-for-deployment', platform = 'aws',
    authentication = {'bucket' : 'S3-bucket-name'})

What Users are saying..

profile image

Abhinav Agarwal

Graduate Student at Northwestern University
linkedin profile url

I come from Northwestern University, which is ranked 9th in the US. Although the high-quality academics at school taught me all the basics I needed, obtaining practical experience was a challenge.... Read More

Relevant Projects

Natural language processing Chatbot application using NLTK for text classification
In this NLP AI application, we build the core conversational engine for a chatbot. We use the popular NLTK text classification library to achieve this.

Isolation Forest Model and LOF for Anomaly Detection in Python
Credit Card Fraud Detection Project - Build an Isolation Forest Model and Local Outlier Factor (LOF) in Python to identify fraudulent credit card transactions.

Multilabel Classification Project for Predicting Shipment Modes
Multilabel Classification Project to build a machine learning model that predicts the appropriate mode of transport for each shipment, using a transport dataset with 2000 unique products. The project explores and compares four different approaches to multilabel classification, including naive independent models, classifier chains, natively multilabel models, and multilabel to multiclass approaches.

Recommender System Machine Learning Project for Beginners-1
Recommender System Machine Learning Project for Beginners - Learn how to design, implement and train a rule-based recommender system in Python

Learn How to Build a Logistic Regression Model in PyTorch
In this Machine Learning Project, you will learn how to build a simple logistic regression model in PyTorch for customer churn prediction.

End-to-End Speech Emotion Recognition Project using ANN
Speech Emotion Recognition using RAVDESS Audio Dataset - Build an Artificial Neural Network Model to Classify Audio Data into various Emotions like Sad, Happy, Angry, and Neutral

NLP Project to Build a Resume Parser in Python using Spacy
Use the popular Spacy NLP python library for OCR and text classification to build a Resume Parser in Python.

PyTorch Project to Build a LSTM Text Classification Model
In this PyTorch Project you will learn how to build an LSTM Text Classification model for Classifying the Reviews of an App .

NLP Project on LDA Topic Modelling Python using RACE Dataset
Use the RACE dataset to extract a dominant topic from each document and perform LDA topic modeling in python.

End-to-End ML Model Monitoring using Airflow and Docker
In this MLOps Project, you will learn to build an end to end pipeline to monitor any changes in the predictive power of model or degradation of data.