set config and save config function in clustering model in pycaret

This recipe explains the set config save config function in clustering model in pycaret. The set config function resets the global variables and the save_config function saves all global variables to a pickle file.

Recipe Objective - What is the set_config, save_config function in the clustering model in pycaret?

PyCaret provides the set_config and save_config function 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

set_config function with Example:-

PyCaret provides "pycaret.clustering.set_config()" function. The set_config function resets the global variables.

Some Accessible variables:-

X: Transformed dataset (X)

data_before_preprocess: data before preprocessing

seed: random state set through session_id

prep_pipe: Transformation pipeline configured through setup

n_jobs_param: n_jobs parameter used in model training

html_param: html_param configured through setup

create_model_container: results grid storage container

master_model_container: model storage container

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)
set_config('seed', 123)

save_config function with Example:-

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

The save_config function saves all global variables to a pickle file, allowing to resume without rerunning the setup later.

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)
# saving our model
save_config('pycaret_clust.pkl')

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

Hands-On Approach to Causal Inference in Machine Learning
In this Machine Learning Project, you will learn to implement various causal inference techniques in Python to determine, how effective the sprinkler is in making the grass wet.

Build Classification Algorithms for Digital Transformation[Banking]
Implement a machine learning approach using various classification techniques in Python to examine the digitalisation process of bank customers.

PyCaret Project to Build and Deploy an ML App using Streamlit
In this PyCaret Project, you will build a customer segmentation model with PyCaret and deploy the machine learning application using Streamlit.

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.

Langchain Project for Customer Support App in Python
In this LLM Project, you will learn how to enhance customer support interactions through Large Language Models (LLMs), enabling intelligent, context-aware responses. This Langchain project aims to seamlessly integrate LLM technology with databases, PDF knowledge bases, and audio processing agents to create a comprehensive customer support application.

Build a Multi-Class Classification Model in Python on Saturn Cloud
In this machine learning classification project, you will build a multi-class classification model in Python on Saturn Cloud to predict the license status of a business.

Build a Similar Images Finder with Python, Keras, and Tensorflow
Build your own image similarity application using Python to search and find images of products that are similar to any given product. You will implement the K-Nearest Neighbor algorithm to find products with maximum similarity.

Word2Vec and FastText Word Embedding with Gensim in Python
In this NLP Project, you will learn how to use the popular topic modelling library Gensim for implementing two state-of-the-art word embedding methods Word2Vec and FastText models.

Build a Autoregressive and Moving Average Time Series Model
In this time series project, you will learn to build Autoregressive and Moving Average Time Series Models to forecast future readings, optimize performance, and harness the power of predictive analytics for sensor data.

Build an optimal End-to-End MLOps Pipeline and Deploy on GCP
Learn how to build and deploy an end-to-end optimal MLOps Pipeline for Loan Eligibility Prediction Model in Python on GCP