set config and save config function in anomaly detection pycaret

This recipe explains the set config and save config function in anomaly detection using pycaret. The set config function resets the global variables and save config function saves all global variables to a pickle file

Recipe Objective - What is the set_config, save_config function in anomaly detection in pycaret?

PyCaret provides the set_config and save_config function in the anomaly detection 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.anomaly.set_config()" function. The set_config function resets the global variables.

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

display_container: results display container

exp_name_log: Name of experiment set through setup

logging_param: log_experiment param set through setup

log_plots_param: log_plots param set through setup

USI: Unique session ID parameter set through setup

gpu_param: use_gpu param configured through setup

from pycaret.datasets import get_data
anmly = get_data('anomaly')
# importing anomaly module
from pycaret.anomaly import *
# initialize the setup
setup_name = setup(data = anmly)
set_config('seed', 123)

save_config function with Example:-

PyCaret provides "pycaret.anomaly.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
anmly = get_data('anomaly')
# importing anomaly module
from pycaret.anomaly import *
# initialize the setup
setup_name = setup(data = anmly)
# saving our model
save_config('model_knn.pkl')

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

Build Real Estate Price Prediction Model with NLP and FastAPI
In this Real Estate Price Prediction Project, you will learn to build a real estate price prediction machine learning model and deploy it on Heroku using FastAPI Framework.

Build a Text Generator Model using Amazon SageMaker
In this Deep Learning Project, you will train a Text Generator Model on Amazon Reviews Dataset using LSTM Algorithm in PyTorch and deploy it on Amazon SageMaker.

Linear Regression Model Project in Python for Beginners Part 1
Machine Learning Linear Regression Project in Python to build a simple linear regression model and master the fundamentals of regression for beginners.

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

Predict Churn for a Telecom company using Logistic Regression
Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

MLOps using Azure Devops to Deploy a Classification Model
In this MLOps Azure project, you will learn how to deploy a classification machine learning model to predict the customer's license status on Azure through scalable CI/CD ML pipelines.

Medical Image Segmentation Deep Learning Project
In this deep learning project, you will learn to implement Unet++ models for medical image segmentation to detect and classify colorectal polyps.

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.

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

End-to-End Snowflake Healthcare Analytics Project on AWS-1
In this Snowflake Healthcare Analytics Project, you will leverage Snowflake on AWS to predict patient length of stay (LOS) in hospitals. The prediction of LOS can help in efficient resource allocation, lower the risk of staff/visitor infections, and improve overall hospital functioning.