Explain remove metric, get logs, get config functions in pycaret

In this recipe, we will explore the remove metrics, get logs, and get configuration functions as they pertain to the classification model in PyCaret

Recipe Objective -What are remove_metric, get_logs, and get_config functions in the classification model in PyCaret?

PyCaret provides remove_metric, get_logs and get_config function in classification module.

Learn How to Build a Multi Class Text Classification Model using BERT

For more related projects:

https://www.dezyre.com/projects/data-science-projects/data-science-projects-in-python
https://www.dezyre.com/projects/data-science-projects/machine-learning-projects-in-python

remove_metric function with Example:

PyCaret provides "pycaret.classification.remove_metric()" function. The remove_metric function removes a metric from CV.

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')
remove_metric('MCC')

get_logs function with Example:

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

get_logs function returns a table of experiment logs. It only works when log_experiment is True when initializing the setup function.

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', log_experiment = True)
comp_model = compare_models()
exp_log = get_logs()
exp_log

get_config function with Example:

PyCaret provides "pycaret.classification.get_config()" function. get_config function retrieves the global variables created when initializing the setup function.

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')
X_train = get_config('X_train')
X_train

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 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.

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.

Hands-On Approach to Regression Discontinuity Design Python
In this machine learning project, you will learn to implement Regression Discontinuity Design Example in Python to determine the effect of age on Mortality Rate in Python.

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.

GCP MLOps Project to Deploy ARIMA Model using uWSGI Flask
Build an end-to-end MLOps Pipeline to deploy a Time Series ARIMA Model on GCP using uWSGI and Flask

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 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.

Loan Eligibility Prediction in Python using H2O.ai
In this loan prediction project you will build predictive models in Python using H2O.ai to predict if an applicant is able to repay the loan or not.

Detectron2 Object Detection and Segmentation Example Python
Object Detection using Detectron2 - Build a Dectectron2 model to detect the zones and inhibitions in antibiogram images.

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.