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

Ameeruddin Mohammed

ETL (Abintio) developer at IBM
linkedin profile url

I come from a background in Marketing and Analytics and when I developed an interest in Machine Learning algorithms, I did multiple in-class courses from reputed institutions though I got good... Read More

Relevant Projects

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.

Build a Multi ClassText Classification Model using Naive Bayes
Implement the Naive Bayes Algorithm to build a multi class text classification model in Python.

MLOps Project for a Mask R-CNN on GCP using uWSGI Flask
MLOps on GCP - Solved end-to-end MLOps Project to deploy a Mask RCNN Model for Image Segmentation as a Web Application using uWSGI Flask, Docker, and TensorFlow.

A/B Testing Approach for Comparing Performance of ML Models
The objective of this project is to compare the performance of BERT and DistilBERT models for building an efficient Question and Answering system. Using A/B testing approach, we explore the effectiveness and efficiency of both models and determine which one is better suited for Q&A tasks.

Learn to Build an End-to-End Machine Learning Pipeline - Part 2
In this Machine Learning Project, you will learn how to build an end-to-end machine learning pipeline for predicting truck delays, incorporating Hopsworks' feature store and Weights and Biases for model experimentation.

Build Time Series Models for Gaussian Processes in Python
Time Series Project - A hands-on approach to Gaussian Processes for Time Series Modelling in Python

Build a Text Classification Model with Attention Mechanism NLP
In this NLP Project, you will learn to build a multi class text classification model with attention mechanism.

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.

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