0% found this document useful (0 votes)
2 views11 pages

Unit 4 - Data Visualization

Uploaded by

charushila
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views11 pages

Unit 4 - Data Visualization

Uploaded by

charushila
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Unit 4

Data Visualization

What is Data Visualization and Why is It Important?


Data visualization is a graphical representation of quantitative information and data by using
visual elements like graphs, charts, and maps.

Data visualization converts large and small data sets into visuals, which is easy to understand
and process for humans.

Data visualization tools provide accessible ways to understand outliers, patterns, and trends in
the data.

In the world of Big Data, the data visualization tools and technologies are required to analyze
vast amounts of information.

Data visualizations are used to discover unknown facts and trends. You can see visualizations
in the form of line charts to display change over time. Bar and column charts are useful for
observing relationships and making comparisons. A pie chart is a great way to show parts-of-
a-whole. And maps are the best way to share geographical data visually.

Why Use Data Visualization?


1. To make it easier to understand and remember.
2. To discover unknown facts, outliers, and trends.
3. To visualize relationships and patterns quickly.
4. To ask a better question and make better decisions.
5. To competitive analysis.
6. To improve insights.
What is Exploratory Data Analysis?
Exploratory Data Analysis (EDA) is an important first step in data science projects. It
involves looking at and visualizing data to understand its main features, find patterns, and
discover how different parts of the data are connected.
EDA helps to spot any unusual data or outliers and is usually done before starting more
detailed statistical analysis or building models.

Why is Exploratory Data Analysis Important?


Exploratory Data Analysis (EDA) is important for several reasons, especially in the context
of data science and statistical modeling. Here are some of the key reasons why EDA is a
critical step in the data analysis process:
Helps to understand the dataset, showing how many features there are, the type of data in
each feature, and how the data is spread out, which helps in choosing the right methods for
analysis.
EDA helps to identify hidden patterns and relationships between different data points, which
help us in and model building.
Allows to spot errors or unusual data points (outliers) that could affect your results.
Insights that you obtain from EDA help you decide which features are most important for
building models and how to prepare them to improve performance.
By understanding the data, EDA helps us in choosing the best modeling techniques and
adjusting them for better results.
Types of Exploratory Data Analysis
There are various sorts of EDA strategies based on the nature of the records. Depending on
the number of columns we are analyzing we can divide EDA into three types: Univariate,
bivariate and multivariate.

1. Univariate AnalysisUnivariate data refers to a type of data in which each observation


or data point corresponds to a single variable. In other words, it involves the measurement or
observation of a single characteristic or attribute for each individual or item in the dataset.
Analyzing univariate data is the simplest form of analysis in statistics.

Heights (in 16 167. 17 174. 17 18 18


cm) 4 3 0 2 8 0 6
Suppose that the heights of seven students in a class is recorded (above table). There is only
one variable, which is height, and it is not dealing with any cause or relationship.

2. Bivariate Analysis
Bivariate data involves two different variables, and the analysis of this type of data focuses
on understanding the relationship or association between these two variables. Examples of
bivariate data can be temperature and ice cream sales in the summer season.

Temperature Ice Cream Sales

20 2000

25 2500

35 5000

Suppose the temperature and ice cream sales are the two variables of a bivariate data(table 2).
Here, the relationship is visible from the table that temperature and sales are directly
proportional to each other and thus related because as the temperature increases, the sales
also increase.

3. Multivariate Analysis
Multivariate data refers to datasets where each observation or sample point consists of
multiple variables or features. These variables can represent different aspects, characteristics,
or measurements related to the observed phenomenon. When dealing with three or more
variables, the data is specifically categorized as multivariate.
Example of this type of data is suppose an advertiser wants to compare the popularity of four
advertisements on a website.
Advertisement Gender Click rate

Ad1 Male 80

Ad3 Female 55

Ad2 Female 123

Ad1 Male 66

Ad3 Male 35

The click rates could be measured for both men and women and relationships between
variables can then be examined. It is similar to bivariate but contains more than one
dependent variable.
Basic data visualization tools-
A data visualization tool is a form of software that’s designed to visualize data. Each tool's
capabilities vary but, at their most basic, they allow you to input a dataset and visually
manipulate it. Most, but not all, come with built-in templates you can use to generate basic
visualizations.

While there are hundreds of ways to visualize data, some of the most common data
visualization techniques include:

● Pie charts
● Bar charts
● Histograms
● Gantt charts
● Heat maps
● Box-and-whisker plots
● Waterfall charts
● Scatter plots
● Maps

Box-and-whisker plots

● When we display the data distribution in a standardized way using 5 summary –


minimum, Q1 (First Quartile), median, Q3(third Quartile), and maximum, it is called
a Box plot. It is also termed as box and whisker plot.
● The method to summarize a set of data that is measured using an interval scale is
called a box and whisker plot. These are maximum used for data analysis.
● In simple words, we can define the box plot in terms of descriptive statistics related
concepts. That means box or whiskers plot is a method used for depicting groups of
numerical data through their quartiles graphically. These may also have some lines
extending from the boxes or whiskers which indicates the variability outside the lower
and upper quartiles, hence the terms box-and-whisker plot and box-and-whisker
diagram. Outliers can be indicated as individual points.
● It helps to find out how much the data values vary or spread out with the help of
graphs. As we need more information than just knowing the measures of central
tendency, this is where the box plot helps. This also takes less space. It is also a type
of pictorial representation of data.
● Parts of Box Plots
Minimum: The minimum value in the given dataset

First Quartile (Q1): The first quartile is the median of the lower half of the data set.

Median: The median is the middle value of the dataset, which divides the given dataset into
two equal parts. The median is considered as the second quartile.

Third Quartile (Q3): The third quartile is the median of the upper half of the data.

Maximum: The maximum value in the given dataset.

Apart from these five terms, the other terms used in the box plot are:

Interquartile Range (IQR): The difference between the third quartile and first quartile is
known as the interquartile range. (i.e.) IQR = Q3-Q1

Outlier: The data that falls on the far left or right side of the ordered data is tested to be the
outliers. Generally, the outliers fall more than the specified distance from the first and third
quartile.

(i.e.) Outliers are greater than Q3+(1.5 . IQR) or less than Q1-(1.5 . IQR).

What is Histogram?
A histogram is a graphical representation of a grouped frequency distribution with continuous
classes. It is an area diagram and can be defined as a set of rectangles with bases along with
the intervals between class boundaries and with areas proportional to frequencies in the
corresponding classes. In such representations, all the rectangles are adjacent since the base
covers the intervals between class boundaries. The heights of rectangles are proportional to
corresponding frequencies of similar classes and for different classes, the heights will be
proportional to corresponding frequency densities.
In other words, a histogram is a diagram involving rectangles whose area is proportional to
the frequency of a variable and width is equal to the class interval.

When to Use Histogram?


The histogram graph is used under certain conditions. They are:

● The data should be numerical.


● A histogram is used to check the shape of the data distribution.
● Used to check whether the process changes from one period to another.
● Used to determine whether the output is different when it involves two or more
processes.
● Used to analyse whether the given process meets the customer requirements.

What is Bar Graph?


The pictorial representation of grouped data, in the form of vertical or horizontal rectangular
bars, where the lengths of the bars are equivalent to the measure of data, are known as bar
graphs or bar charts.

The bars drawn are of uniform width, and the variable quantity is represented on one of the
axes. Also, the measure of the variable is depicted on the other axes. The heights or the
lengths of the bars denote the value of the variable, and these graphs are also used to compare
certain quantities. The frequency distribution tables can be easily represented using bar charts
which simplify the calculations and understanding of data.

The three major attributes of bar graphs are:

● The bar graph helps to compare the different sets of data among different groups
easily.
● It shows the relationship using two axes, in which the categories are on one axis and
the discrete values are on the other axis.
● The graph shows the major changes in data over time.

Example 1:
In a firm of 400 employees, the percentage of monthly salary saved by each employee is
given in the following table. Represent it through a bar graph.

savings (in percentage) Number of Employees(Frequency)

20 105

30 199

40 29

50 73

Total 400
Scatter plot Graph
● A scatter plot is also called a scatter chart, scattergram, or scatter plot, XY graph. The
scatter diagram graphs numerical data pairs, with one variable on each axis, show
their [Link] plots are used in either of the following situations.
● When we have paired numerical data
● When there are multiple values of the dependent variable for a unique value of an
independent variable
● In determining the relationship between variables in some scenarios, such as
identifying potential root causes of problems, checking whether two products that
appear to be related both occur with the exact cause and so on.

Scatter Plot Uses and Examples


Scatter plots instantly report a large volume of data. It is beneficial in the following situations

● For a large set of data points given


● Each set comprises a pair of values
● The given data is in numeric form
line chart
A line chart graphically represents an asset's price over time by connecting a series of data points with
a line. This is the most basic type of chart used in finance, and it typically only depicts a security's
closing prices. Line charts can be used for any time frame but most often have day-to-day price
changes.
● A line chart displays information as a series of data points connected by straight line
segments.
● A line chart visually represents an asset's price history using a single line.
● Line charts usually only plot the closing prices, thus reducing noise from less critical times in
the trading day, such as the open, high, and low prices.
● Line charts can be simplistic and do not fully capture patterns or trends.

What is a Pie Chart?


The “pie chart” is also known as a “circle chart”, dividing the circular statistical graphic into
sectors or sections to illustrate the numerical problems. Each sector denotes a proportionate
part of the whole. To find out the composition of something, Pie-chart works the best at that
time. In most cases, pie charts replace other graphs like the bar graph, line plots, histograms,
etc.

Formula
The pie chart is an important type of data representation. It contains different segments and
sectors in which each segment and sector of a pie chart forms a specific portion of the
total(percentage). The sum of all the data is equal to 360°.

The total value of the pie is always 100%.

To work out with the percentage for a pie chart, follow the steps given below:

● Categorize the data


● Calculate the total
● Divide the categories
● Convert into percentages
● Finally, calculate the degrees

Therefore, the pie chart formula is given as

(Given Data/Total value of Data) × 360°

Note: It is not mandatory to convert the given data into percentages until it is specified. We
can directly calculate the degrees for given data values and draw the pie chart accordingly.

How to Create a Pie Chart?

You might also like