Lazy Predict is a Python library designed to compare the performance of various machine learning models on a dataset. If you don’t know how to select an algorithm when training a machine learning model, this article is for you. In this article, I’ll walk you through a tutorial on the Lazy Predict library in Python which can be used while comparing the performance of various machine learning models on a dataset.
Introduction to Lazy Predict
When working on a regression or classification based machine learning problem where you want to compare which model will work best on your dataset, you should train and test the performance of various machine learning models one by one on your dataset. This is where the Lazy Predict library in Python comes in. It allows you to compare the performance of all classification and regression models in a few lines of code.
So, by using Python’s lazy predict library, you can easily compare the performance of all machine learning models so that you can choose the best performing model for your problem. If you have never used this library before, you can easily install it in your system using the pip command:
- pip install lazypredict
In the section below, I’ll take you through a tutorial on how to use the lazypredict library in Python to compare the performance of machine learning models.
Lazy Predict in Python (Tutorial)
Let’s import the necessary Python libraries and a dataset based on the classification problem and prepare the data to fit into the machine learning model:
Now, here is how you can use the Lazy Predict Library to check the performance of all classification machine learning models:

Now let’s again import the necessary Python libraries and a dataset based on the regression problem and prepare the data to fit into the machine learning model:
Now, here’s how to use the Lazy Predict library to check the performance of all regression machine learning models:

Summary
So this is how you can use the Lazy Predict library in Python to compare the performance of various machine learning models based on classification and regression. If you don’t know how to select an algorithm when training a machine learning model then you should use this Python library. I hope you liked this article on a tutorial on the Lazy Predit library in Python. Feel free to ask your valuable questions in the comments section below.