Automated Visualization with AutoViz

Ajay Mane
3 min readMay 28, 2021

Autoviz is an open-source python library that mainly works on visualizing the relationship of the data, it can find the most impactful features and plot creative visualization in just one line of code. Autoviz is incredibly fast and highly useful.

Install

Before Exploring Autoviz we need to install it by using pip install AutoViz.

!pip install autoviz

Implementation

#Import Libraries 
import pandas as pd
from autoviz.AutoViz_Class import AutoViz_Class
Av = AutoViz_Class()

About Dataset

1.Pregnancies: Number of times pregnant

2.Glucose: Plasma glucose concentration a 2 hours in an oral glucose tolerance test

3.blood pressure: Diastolic blood pressure (mm Hg)

4.SkinThickness: Triceps skinfold thickness (mm)

5.Insulin: 2-Hour serum insulin (mu U/ml)

6.BMI: Body mass index (weight in kg/(height in m)²)

7.DiabetesPedigreeFunction: Diabetes pedigree function

8.Age: Age (years)

9.Outcome: Class variable (0 or 1)

df = pd.read_csv("diabetes.csv")
df.head()

Classifying Variables

df = Av.AutoViz(filename="",sep=',', depVar='Glucose', dfte=df, header=0,verbose=2,lowess=False,chart_format='svg',max_rows_analyzed=150000, max_cols_analyzed=5)df = Av.AutoViz(filename="",sep=',', depVar='Insulin', dfte=df, header=0,verbose=2,lowess=False,chart_format='svg',max_rows_analyzed=150000, max_cols_analyzed=5)df = Av.AutoViz(filename="",sep=',', depVar='BMI', dfte=df, header=0,verbose=2,lowess=False,chart_format='svg',max_rows_analyzed=150000, max_cols_analyzed=5)df = Av.AutoViz(filename="",sep=',', depVar='BloodPressure',dfte=df, header=0,verbose=2,lowess=False,chart_format='svg',max_rows_analyzed=150000, max_cols_analyzed=5)

Visualize Data Using AutoViz

df = Av.AutoViz("diabetes.csv")Shape of your Data Set: (768, 9)
############## C L A S S I F Y I N G V A R I A B L E S ####################
Classifying variables in data set...
Number of Numeric Columns = 2
Number of Integer-Categorical Columns = 6
Number of String-Categorical Columns = 0
Number of Factor-Categorical Columns = 0
Number of String-Boolean Columns = 0
Number of Numeric-Boolean Columns = 1
Number of Discrete String Columns = 0
Number of NLP String Columns = 0
Number of Date Time Columns = 0
Number of ID Columns = 0
Number of Columns to Delete = 0
9 Predictors classified...
This does not include the Target column(s)
No variables removed since no ID or low-information variables found in data set
Number of All Scatter Plots = 3
Time to run AutoViz (in seconds) = 8.605#######VISUALIZATION Completed #################

--

--