What are set config, save config, and load config in PyCaret?

The purpose of this recipe is to demonstrate how to use set config, save config and load config functions in PyCaret through examples.

Recipe Objective - What are set_config, save_config, and load_config in the classification model in PyCaret?

PyCaret provides set_config, save_config, and load_config functions in the classification module.

For more related projects:

https://www.projectpro.io/article/7-types-of-classification-algorithms-in-machine-learning/435

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

set_config function with Example:

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

List of Classification Algorithms in Machine Learning

Some Accessible variables:

X: Transformed dataset (X)

y: Transformed dataset (y)

X_train: Transformed train dataset (X)

X_test: Transformed test/holdout dataset (X)

y_train: Transformed train dataset (y)

y_test: Transformed test/holdout dataset (y)

from pycaret.datasets import get_data
iris = get_data('iris')
# importing classification module
from pycaret.classification import *
# initialize setup
setup_name = setup(data = iris, target = 'species')
set_config('seed', 123)

save_config function with Example:

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

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
iris = get_data('iris')
# importing classification module
from pycaret.classification import *
# initialize setup
setup_name = setup(data = iris, target = 'species')
# saving our model
save_config('my_pycaret_model.pkl')

load_config function with Example:

PyCaret provides "pycaret.classification.load_config()" function.

load_config function loads global variables from a pickle file into Python environment.

from pycaret.classification import load_config
# "my_pycaret_model is already been saved"
load_config('my_pycaret_model.pkl')

What Users are saying..

profile image

Jingwei Li

Graduate Research assistance at Stony Brook University
linkedin profile url

ProjectPro is an awesome platform that helps me learn much hands-on industrial experience with a step-by-step walkthrough of projects. There are two primary paths to learn: Data Science and Big Data.... Read More

Relevant Projects

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.

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.

Build Multi Class Text Classification Models with RNN and LSTM
In this Deep Learning Project, you will use the customer complaints data about consumer financial products to build multi-class text classification models using RNN and LSTM.

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

Deep Learning Project for Text Detection in Images using Python
CV2 Text Detection Code for Images using Python -Build a CRNN deep learning model to predict the single-line text in a given image.

OpenCV Project to Master Advanced Computer Vision Concepts
In this OpenCV project, you will learn to implement advanced computer vision concepts and algorithms in OpenCV library using Python.

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.

Build a Face Recognition System in Python using FaceNet
In this deep learning project, you will build your own face recognition system in Python using OpenCV and FaceNet by extracting features from an image of a person's face.

Build OCR from Scratch Python using YOLO and Tesseract
In this deep learning project, you will learn how to build your custom OCR (optical character recognition) from scratch by using Google Tesseract and YOLO to read the text from any images.

Time Series Forecasting with LSTM Neural Network Python
Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.