Lazy Predict!

A Basic Example Using the Boston House Prices Dataset

Table of Contents

Overview

Am pretty excited about this example. LazyPredict automatically scores data with a bunch of different models allowing the user to see performance across a variety of methods. I think this is where things are headed.

Here is more information about this method: https://pypi.org/project/lazypredict/

The first step is to install it. You can go to Anaconda, click on the environment, and then open the terminal using the "play button" next to the environment you want to install it in. Then you can enter the command: pip install lazypredict

NOTE: You may also need to install modules called tqdm, xgboost, lightgbm, and pytest. You can repeat the process about to install via: pip install tqdm

Pre-requisites

This post assumes that you have:

Data Exploration

First we import a the boston house prices dataset, and print a description of it so we can examine what is in the data. Remember in order to execute a 'cell' like the one below, you can 1) click on it and run it using the run button above or 2) click in the cell and hit shift+enter.

We randomly select a third of our data to be the 'test' dataset. This way we can train our model on 2/3 of the data, and test it on the remainder. Once we are confident that our model is generalizing well (i.e. there is not a HUGE different in the training/testing performance, or in other words, not obviously overfitting), then we can use all of our data to train the model.

Lazy Predict

We run LazyPredict:

You can compare to the OLS method: https://predictivemodeler.com/2019/08/19/py-ols-boston-house-prices/

Feedback

If you have ideas on how to improve this post, please let me know: https://predictivemodeler.com/feedback/

Reference: py.lazypredict_boston