Autoviz: Automatically Visualize any Dataset
By: Himanshu Sharma
Tags: Machine Learning, Data Visualization, Data, Data Science, Data Analysis

Autoviz: Automatically Visualize any Dataset

Visualize dataset of any size with just one line of code

Visualization is a technique that is used to visualize the data using different graphs and plots. In data science, we generally use data visualization techniques to understand the dataset and find the relation between the data. Visualization can also help in finding the pattern in the dataset which is used for further analysis.

There are different techniques/libraries in python which are used for Data Visualization like Matplotlib, Seaborn, Plotly, etc. But while using all these libraries we need to define the type of graph we want to visualize and the arguments which we need to visualize.

In this article, we will learn about a python library AutoViz which can automate the whole process of Data Visualization in just a single line of code.

AutoViz performs automatic visualization of any dataset with just one line of code. AutoViz can find the most important features and plot impactful visualizations only using those automatically selected features. Also, AutoViz is incredibly fast so it creates visualization within seconds.

Let’s start exploring AutoViz with help of some dataset. Before using AutoViz we need to install it.

Install AutoViz

Like any other python library, we can install AutoViz by using the pip install command given below.

pip install autoviz

Loading the Dataset and Analyzing

Here I will be using different datasets to visualize/explore different types of charts/plots which AutoViz can produce. You can check out and download all the datasets from the Github repository.

Car Design Dataset

This data set contains different attributes of different car manufacturers. Let us visualize this dataset using AutoViz.

AutoViz can be implemented in 3 easy steps which are given below.

#importing Autoviz class

from autoviz.AutoViz_Class import AutoViz_Class #Instantiate the AutoViz class

AV = AutoViz_Class()

These steps will import the AutoViz class and instantiate it. The final step is to create the visualization. Just this single line of code will create all the visualization taking all the attributes in the count.

df = AV.AutoViz('car_design.csv')

a. Histograms(KDE Plots)of all continuous variables

b. Violin Plots of Continuous variables

c. Heatmap of continuous variables

As you can see above these are the different plots that are generated using the AutoViz in just one line of code.

Let us analyze one more dataset, in this data, there are 4 Attributes depicting the Advertising expenditure along with sales of a company. We will analyze this by creating the step used above just changing the dataset.

2. Advertising Dataset

Here we will pass one more argument depVar which is the dependent variable so that AutoViz creates visualization accordingly. In this dataset, we know that ‘sales’ is the dependant variable.

df = AV.AutoViz('Advrtising.csv', depVar='Sales')

a. Scatter plot of variables against Sales

‘Sales’ is dependant

Similarly, you will see that it will create the histogram, violin plot, heatmap, etc. keeping the ‘Sales’ as a dependant variable.

Some other arguments which we can pass while calling AutoViz are:

sep, which is the separator by which data is separated, by default it is ‘,’. target, which is the target variable in the dataset. chart_format is the format of the chart displayed. max_row_analyzed is used to define the number rows to be analyzed max_cols_analyzed is used to define the number of columns to be analyzed.

In this article, we saw that we can visualize datasets with just one line of code and we can find the patterns in the dataset accordingly.

AutoViz is capable of adapting to any number of different data contexts such as regression, classification, or even time-series data. Go ahead and explore this library using different datasets and share your experiences in the response section.

Before You Go

Thanks for reading! If you want to get in touch with me, feel free to reach me on hmix13@gmail.com or my LinkedIn Profile. You can also view the code and data I have used here in my Github.