save model and load model function in clustering in pycaret

This recipe explains the save model and load model function in clustering model in pycaret. The Save model function saves the transformation pipeline and the load model function loads a previously saved pipeline.

Recipe Objective - What is the save_model, load_model function in the clustering model in pycaret?

PyCaret provides save_model and load_model in the clustering module.

 

For more related projects:-

https://www.projectpro.io/projects/data-science-projects/tensorflow-projects
https://www.projectpro.io/projects/data-science-projects/keras-deep-learning-projects

Save model function with Example:-

PyCaret provides "pycaret.clustering.save_model()" function.

The Save model function saves the transformation pipeline and trained model object into the current working directory as a pickle file for later use.

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')
# saving model
save_model(k_m, 'saved_kmean_model')

load_model function with Example:-

PyCaret provides "pycaret.clustering.load_model()" function.

The load model function loads a previously saved pipeline.

from pycaret.clustering import load_model
saved_km = load_model('saved_kmean_model')
saved_km

What Users are saying..

profile image

Ed Godalle

Director Data Analytics at EY / EY Tech
linkedin profile url

I am the Director of Data Analytics with over 10+ years of IT experience. I have a background in SQL, Python, and Big Data working with Accenture, IBM, and Infosys. I am looking to enhance my skills... Read More

Relevant Projects

AWS MLOps Project to Deploy Multiple Linear Regression Model
Build and Deploy a Multiple Linear Regression Model in Python on AWS

Build a Churn Prediction Model using Ensemble Learning
Learn how to build ensemble machine learning models like Random Forest, Adaboost, and Gradient Boosting for Customer Churn Prediction using Python

Build CI/CD Pipeline for Machine Learning Projects using Jenkins
In this project, you will learn how to create a CI/CD pipeline for a search engine application using Jenkins.

Deploy Transformer-BART Model on Paperspace Cloud
In this MLOps Project you will learn how to deploy a Tranaformer BART Model for Abstractive Text Summarization on Paperspace Private Cloud

Learn to Build Generative Models Using PyTorch Autoencoders
In this deep learning project, you will learn how to build a Generative Model using Autoencoders in PyTorch

Build an Image Classifier for Plant Species Identification
In this machine learning project, we will use binary leaf images and extracted features, including shape, margin, and texture to accurately identify plant species using different benchmark classification techniques.

ML Model Deployment on AWS for Customer Churn Prediction
MLOps Project-Deploy Machine Learning Model to Production Python on AWS for Customer Churn Prediction

Model Deployment on GCP using Streamlit for Resume Parsing
Perform model deployment on GCP for resume parsing model using Streamlit App.

Build Regression Models in Python for House Price Prediction
In this Machine Learning Regression project, you will build and evaluate various regression models in Python for house price prediction.

Image Segmentation using Mask R-CNN with Tensorflow
In this Deep Learning Project on Image Segmentation Python, you will learn how to implement the Mask R-CNN model for early fire detection.