0% found this document useful (0 votes)
28 views174 pages

Understanding Database Schemas and Visualizations

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)
28 views174 pages

Understanding Database Schemas and Visualizations

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

What is Schema?

• A schema is the blueprint or structure that defines how data


is organized and stored in a database.
• It outlines the tables, fields, relationships, views, indexes,
and other elements within the database.
• The schema defines the logical view of the entire database
and specifies the rules that govern the data, including its
types, constraints, and relationships.
Cont.
Dimension Table
• A Dimension Table can be defined as a type of table within a data
warehouse that holds attributes or facts that are associated or linked
to the objects or events recorded in a fact table.
• It gives the basic information that may be used to understand or
categorize objects and events to allow the user to perform more pro
forma analysis.
• Its primary function is to filter, group, and summarize the content of
the fact table together with the measures.
• It contains primary keys that relate to foreign keys in the fact table,
while the other attributes describe the dimensions of aspects of time,
geography, products or customers, respectively.
Star Schema
• Star Schema is a type of multidimensional model used for data
warehouses.
• In a star schema, the fact tables and dimension tables are included.
• This schema uses fewer foreign-key joins.
• It forms a star structure with a central fact table connected to the
surrounding dimension tables.
Star Schema
Snowflake Schema
• Snowflake Schema is also a type of multidimensional model used for
data warehouses.
• In the snowflake schema, the fact tables, dimension tables and sub-
dimension tables are included.
• This schema forms a snowflake structure with fact tables, dimension
tables and sub-dimension tables.
Snowflake Schema
Fact Table
• In a data warehouse, a Fact Table typically includes foreign keys to
dimension tables, allowing for complex queries and detailed
reporting.
• These tables are designed to handle large volumes of data and are
optimized for fast retrieval of information, making them vital for
decision-making processes.
Waterfall Chart
Dr. Chandrashekhar Patel
• A Waterfall Chart is a type of data visualization that
shows how an initial value increases or decreases
through a series of intermediate positive or negative
values, eventually reaching a final total.
• It’s often used in financial analysis, profit-loss
breakdowns, and budget tracking.
• Each bar starts where the previous one ended, showing
cumulative effects.
• Numerical Example (Profit Analysis)
• A company starts with a revenue of ₹1,000,000. Then:
• Production Cost: –₹300,000
• Marketing Cost: –₹150,000
• Other Income: +₹50,000
• Tax: –₹200,000
• Final Profit = ₹1,000,000 – 300,000 – 150,000 +
50,000 – 200,000 = ₹400,000
Tree Map
Dr. Chandrashekhar Patel
Tree Map
• A Tree Map is a visualization that displays
hierarchical (tree-structured) data using nested
rectangles.
Each rectangle represents a category (or subcategory),
and the size and color of the rectangle represent
different quantitative values.
Hierarchy: Data is divided
into levels — like Category
→ Sub-Category → Value.
Rectangle size: Represents
a numerical measure (e.g.,
Structure sales, revenue, population).
Color: Represents a second
measure (e.g., profit,
growth rate).
Sub- Sales Profit
Category
Category (₹) (₹)

Electronics Mobiles 80,000 10,000

Electronics Laptops 1,20,000 20,000

Example Furniture Chairs 50,000 5,000

Furniture Tables 30,000 -2,000

Stationery Pens 20,000 2,000

Stationery Notebooks 40,000 3,000


Total Sales
Category
(₹)

Total Sales Electronics 2,00,000


per
Category Furniture 80,000

Stationery 60,000

Total 3,40,000
Calculate % Share (Area
Size)

Total
Category % of Total Area
Sales
(200000 ÷ 340000) ×
Electronics 2,00,000
100 = 58.8%
(80000 ÷ 340000) ×
Furniture 80,000
100 = 23.5%
(60000 ÷ 340000) ×
Stationery 60,000
100 = 17.6%
• Now divide each category rectangle based on
Sub-Divide sub-category sales:
• Electronics:
Each • Mobiles: 80,000 → (80,000 ÷ 2,00,000) × 100
Category = 40% of Electronics area
• Laptops: 1,20,000 → 60% of Electronics area
by Sub- • Furniture:
Category • Chairs: 50,000 → 62.5% of Furniture area
• Tables: 30,000 → 37.5% of Furniture area
• Stationery:
• Pens: 20,000 → 33.3% of Stationery area
• Notebooks: 40,000 → 66.6% of Stationery area
Add Color by Profit

Sub-Category Profit Color

Laptops 20,000 Dark Green

Mobiles 10,000 Light Green

Chairs 5,000 Light Green

Tables -2,000 Red

Notebooks 3,000 Light Green

Pens 2,000 Light Green


The largest block will be Electronics,
as it has the highest total sales.

Interpretati Inside Electronics, Laptops occupy a


on of the larger area than Mobiles.

Tree Map Tables in Furniture appear small and


red, showing low sales and loss.
Stationery is the smallest overall
category, but all subcategories are
profitable.
Text Table
Dr. Chandrashekhar Patel
Text Table
• A Text Table (also known as a Table View or
Crosstab) is one of the simplest and most traditional
forms of data visualization. It displays data in rows
and columns, where numbers and text are organized
clearly so users can easily compare values and
analyze relationships between different categories.
• In visualization tools like Tableau, Power BI, or Excel,
text tables are often used to present exact numeric
values, unlike charts that focus on trends or patterns.
Word Cloud
• A Word Cloud (also called a Tag Cloud) is a popular form
of data visualization used to display text data in a
visually engaging way.
It shows the most frequent words in a dataset, where
the size (and sometimes color) of each word represents
its frequency or importance.
Time Series and Trend Analysis
• A Time Series is a sequence of data points collected or
recorded at regular time intervals (such as daily,
monthly, or yearly).
It helps in analyzing how values change over time,
revealing patterns, trends, and seasonal
variations.
• Trend Analysis, on the other hand, is the process of
identifying the overall direction (upward, downward,
or stable) in the data over time.
Key Points:
• Time Series Data: Data collected over time (e.g., sales
per month, temperature per day, stock price per hour).
• Trend: Long-term increase or decrease in data.
• Seasonality: Repeated patterns over specific periods
(like sales increasing every December).
• Noise: Random variations not part of trend or
seasonality.
Trend Analysis using Least Squares
Method
Month (X) Sales (Y)
1 50
2 55
3 60
4 65
5 70
Forecasting (Future Prediction)

• Using either:
• Regression trend equation (Y = a + bX)
• Moving average method
• Exponential smoothing
• ARIMA model (for advanced forecasting)
Concept Meaning Example

Time Series Data over time Monthly sales

Sales increasing
Trend Long-term direction
steadily
Summary
Seasonality Periodic variation High sales in summer

Noise Random fluctuations Sudden dips or spikes

Predicting future Next month’s


Forecasting
values expected sales
Scatter Plot
Dr. Chandrashekhar Patel
What is a Scatter Plot?

• A scatter plot is used to plot the relationship between


two variables, on a two-dimensional graph that is known
as Cartesian Plane on mathematical grounds.
Applications of Scatter Plot

• Correlation Analysis: Scatter plot is useful in the


investigation of the correlation between two different
variables. It can be used to find out whether two
variables have a positive correlation, negative
correlation or no correlation.
• Outlier Detection: Outliers are data points, which are
different from the rest of the data set. A Scatter Plot is
used to bring out these outliers on the surface.
• Cluster Identification: In some cases, scatter plots
can help identify clusters or groups within the data.
Types of Scatter Plot

• On the basis of correlation of two variables, Scatter Plot


can be classified into following types.
• Scatter Plot For Positive Correlation
• Scatter Plot For Negative Correlation
• Scatter Plot For Null Correlation
Example

Student Hours studied (X) Exam Score (Y)


Can you
A 2 40
predict the
B 4 55 marks a
C 6 65 student will
D 8 75 get if they
study for 7
E 10 90
hours?
Where r is
Pearson
Correlation (r)
Box and Whisker Plot
Box Plot (Box-and-Whisker Plot)
• Box and Whisker Plot is defined as a visual representation of
the five-point summary. The Box and Whisker Plot is also
called as Box Plot.
• Used to show the distribution of numerical data.
• Displays five-number summary: minimum, first quartile
(Q1), median (Q2), third quartile (Q3), and maximum.
• Helps identify outliers and skewness in the data.
An outlier is a value that is very different from the rest of
the data. It is too high or too low compared to other
numbers.
• Example Use Case: Analyzing exam scores distribution
among students.
Example of Box and Whisker
Plot
• Data (test scores): 78, 85, 90, 92, 95, 96, 97, 98, 99, 100, 105,
110, 120.
• Solution:
• Step 1: Collect Data
• Dataset: 78, 85, 90, 92, 95, 96, 97, 98, 99, 100, 105, 110, 120
• Step 2: Calculate Quartiles
• To create a Box and Whisker Plot, we need to calculate the
quartiles (Q1 and Q3) and the median (Q2).
• -Q1 (the first quartile) is the median of the lower half of the data
(78, 85, 90, 92, 95, 96) = 91
• -Q2 (the median) is the median of the entire dataset = 97
• -Q3 (the third quartile) is the median of the upper half of the
data: (98, 99, 100, 105, 110, 120) = 102.5
• Step 3: Determine Whiskers
• To find the whiskers, calculate the minimum and maximum values within the dataset, excluding potential
outliers.
• Minimum = 78, Maximum = 120
• The required five-number summary is 78, 91, 97, 102.5, 120.
• Step 4: Plot the Box and Whiskers
• Now, we can create the Box and Whisker Plot:
• -Draw a box from Q1 (91) to Q3 (102.5).
• -Draw a line inside the box at Q2 (97).
• -Extend the left whisker from the minimum (78) to Q1 (91).
• -Extend the right whisker from Q3 (102.5) to the maximum (120).
• Step 5: Identify Outliers
• Any data points that fall outside the whiskers are considered outliers. In this case, we do not have any
outliers. This Box and Whisker Plot gives a visual rundown of the grades, showing the middle (Q2) at 97,
the interquartile range (IQR) from Q1 to Q3 (91 to 102.5), and the shortfall of exceptions. It successfully
outlines the focal propensity, spread, and dissemination of the dataset.
• Let's say we have the following exam scores for a class of
• 20 students:Exam Scores:45, 50, 55, 58, 60, 61, 62, 63, 65,
68, 70, 72, 75, 78, 80, 82, 85, 88, 90, 95
• Five-Number Summary
• Calculation:Minimum (Min): Smallest value → 45
• First Quartile (Q1 - 25th percentile):
• Median of the lower half → 60
• Median (Q2 - 50th percentile): Middle value → 68
• Third Quartile (Q3 - 75th percentile):
• Largest value → 95
Scatter Plot
• A Scatter Plot is used to show relationships or correlations between
two numeric variables.
When to Use
• To check correlation (positive, negative, or none)
• To find clusters or outliers
• For trend analysis
Waterfall Chart
• A Waterfall Chart shows how a starting value changes step-by-step
with additions and subtractions, leading to a final value.
Example
• Imagine you earned ₹10,000 in a month:
• Start: ₹10,000
• Rent: -₹3000
• Groceries: -₹2000
• Freelance Income: +₹1500
• Final Balance: ₹6500
• A Waterfall Chart will show each step as a bar — going up for
income, down for expenses, and the final bar shows your remaining
balance.
Pictogram Chart
• A Pictogram Chart (or pictograph) is a type of chart that uses icons or
pictures to represent data values.
• Instead of using bars or lines, it uses symbols where each symbol
stands for a certain number.
What is a Word Cloud?
• A Word Cloud is a visual representation of text data where:
• Each word’s size shows how frequently it appears.
• The more a word shows up in your data → the bigger and bolder it
appears.
Why Use a Word Cloud?
• To quickly see important or common words
• To analyze feedback, reviews, comments, or tweets
• Great for text-heavy data
Area Chart
Dr. Chandrashekhar Patel
• An area chart is a data visualization that displays
quantitative data, typically over time, by plotting data
points connected by line segments.
• The distinguishing feature is that the area between the
line and the x-axis is filled with color or shading, which
emphasizes the magnitude of the values and gives a
sense of volume.
Types of area charts
• Simple area chart: Shows a single data series over
time. It is useful for observing the overall trend and
fluctuations of one variable.
• Stacked area chart: Displays multiple data series on
the same chart, with each series stacked on top of the
one below it.
• It shows how each part contributes to a changing total over
time.
• However, it can be difficult to precisely compare the changes
of individual series because only the bottom layer has a
consistent baseline.
• 100% stacked area chart: A variation of the stacked
chart that shows the relative, or percentage,
contribution of each series to the total over time. The
When to use an area chart
• Area charts are most effective when your primary goal is to
visualize cumulative values or part-to-whole relationships
over a continuous dimension, such as time.
• Highlighting volume: The shaded area provides an intuitive
visual representation of the magnitude of change, making it
easy to see overall growth or decline.
• Part-to-whole analysis: Stacked and 100% stacked area
charts are excellent for visualizing how individual
components contribute to a total over time.
• Emphasizing trends: While similar to line charts, the filled
area can make trends and overall patterns more dramatic
and impactful.
Pictogram Chart
Dr. Chandrashekhar Patel
• A pictograph is a visual representation of data
employing images or symbols.
• It depicts the frequency or occurrence of data by
utilizing relevant symbols or images.
• Pictographs provide a straightforward method to convey
statistical information.
Parts of a pictograph
• Parts of a pictograph include the following:
• Title: It is a title that describes what the pictograph is
of.
• Icon or Symbol: This visual representation represents
individual data points or categories.
• Data values: It represents the quantity of each data
point.
• Labels: It provides more details about the data points.
• Color (optional): It adds more meaning or readability
to the pictograph.
How to Make a Pictograph?

• To create a pictograph, follow the steps listed below:


• Understand the data: The first and foremost step to
creating a pictograph is to understand the data i.e. the type
of data given to create a pictograph.
• Choose icons or symbols: To create your pictograph you
need to select an icon or image by which you are going to
represent the data.
• Provide a scaling factor: You need to provide a scaling
factor that represents the quantity or value of the icon.
• Use colours: This is the optional step that is used to
enhance your pictograph.
• Present your Pictograph: After performing the above
steps you can present it as a presentation.
How to Read a Pictograph?

• Identify the data points: Identify the data points as


they are labelled by using the meaning of images or
icons.
• Count the icons or symbols: Count the number of
icons or symbols associated with it. The number of icons
represents the value of that data point. If there is a
scaling factor, keep that in mind when counting.
• Interpret the data: Use the information you gathered
in step 3 to interpret the data. For instance, if you see
three apple images in a category called "Apples," and
the key says that each icon symbolizes five apples, you
may figure out that there are 3 x 5 = 15 apples in that
category.
Outlier & Evolution
Analysis
Dr. Chandrashekhar Patel
Outlier Analysis
• Outlier analysis (also known as outlier detection or
anomaly detection) is the process of identifying data
points that significantly differ from the rest of the
dataset.
• Purpose:
• Detect unusual events or errors.
• Identify frauds, faults, or rare behaviors.
• Improve data quality before modeling.
Statistical Methods:
• Z-Score or Standard Deviation:
Example:
Example:
Evolution Analysis
• Evolution analysis studies how data or patterns
change over time. It helps in identifying trends,
transitions, or evolving behavior in a dataset.
• Purpose:
• To discover time-based changes in patterns.
• To understand trends, seasonality, or shifts in customer
or system behavior.
Techniques Used:

• Time Series Analysis:


• ARIMA, Exponential Smoothing, or LSTM models to analyze
and forecast evolution.
• Sequential Pattern Mining:
• Identifies how patterns evolve in sequences (e.g., customer
purchase behavior).
• Concept Drift Detection:
• Used in streaming data where the statistical properties of data
change over time.
• Trend and Change Detection Algorithms:
• Moving averages, change-point detection, etc.
Difference

Aspect Outlier Analysis Evolution Analysis


Studying changes and trends
Focus Identifying abnormal data points
over time
Dynamic (time-series or
Data Type Static (single dataset)
sequential)
Goal Detect rare or suspicious events Understand how data evolves
Z-score, IQR, DBSCAN, Time-series, trend analysis,
Techniques
Isolation Forest ARIMA, concept drift
Sales forecasting, behavior
Use Case Fraud detection
analysis
Network Diagram
Dr. Chandrshekhar Patel
Introduction
• A network diagram in data visualization is a
graphical representation of relationships (connections)
between entities (nodes).
• It is commonly used to show how different elements are
linked or interact with each other.
• Nodes (Vertices): Represent entities (e.g., people,
computers, cities, or concepts).
• Edges (Links): Represent the connections or
relationships between nodes (e.g., friendships,
communication lines, trade routes).
Key Features:
• Structure: Shows the overall structure of a network
(who/what is connected to whom/what).
• Directionality: Edges can be directed (arrows showing
flow) or undirected (simple connections).
• Weights: Edges may carry weights (e.g., strength of
connection, frequency, cost).
• Clusters/Communities: Helps detect groups of nodes
that are closely connected.
IN & OUT Degree
Numerical
• Given Referral Network:
• A → B, A → C
•B→D
• C → E, C → F
•D→G
• Step 1: Out-degree of Customer A
• Out-degree = Number of direct referrals made by a
customer (number of outgoing edges).
• Customer A referred B and C → 2 referrals.
• Out-degree of Customer A = 2
• Step 2: Most Influential Customer
• We measure "influence" here as the total number of
people referred directly or indirectly.
• A’s influence = B, C, D, E, F, G → 6 people
• B’s influence = D, G → 2 people
• C’s influence = E, F → 2 people
• D’s influence = G → 1 person
• E, F, G’s influence = 0
• Final Answer:
• Out-degree of Customer A = 2
• Most influential customer = A (since A’s referral
chain reaches 6 customers in total)
Q2. Supply Chain Network
(Shortest Path)
• A manufacturer ships goods from Factory A to Warehouse
D. The transportation costs are:
•A→B=4
•A→C=6
•B→C=2
•B→D=5
•C→D=3
• Question:
Find the minimum transportation cost from A to D using
the network diagram.
• Step 1: List All Possible Paths from A → D
•A→B→D=4+5=9
•A→C→D=6+3=9
•A→B→C→D=4+2+3=9
• Final Answer:
• Minimum transportation cost = 9
• Possible shortest routes:
•A→B→D
•A→C→D
•A→B→C→D
Heat Map
• A heat map is a data visualization technique that represents
numerical data using colour gradients.
• It is particularly useful for: Identifying patterns and trends in data.
• Highlighting correlations in datasets.
• Analysing large volumes of data at a glance.
• Here’s a numerical example of a heat map created using student
marks across 5 subjects.
• Each row = a student (S1–S6).
• Each column = a subject (Math, Science, English, History, CS).
• Color intensity = how high or low the marks are.
• Darker/red cells = higher marks, lighter/yellow cells = lower marks.
Cont.
• This way, we can quickly spot:
• S3 is consistently strong (dark red cells).
• S4 is weaker across all subjects (lighter cells).
• Other students have mixed performance.
Correlation matrix heat map example
• Each cell shows the correlation coefficient (between -1 and +1).
• Darker red = strong positive correlation (scores rise together).
• Darker blue = negative correlation (if one goes up, the other goes
down).
• Values near 0 = weak or no correlation.
• In this example, subjects like Math & English, Science & CS have
strong positive correlations, meaning students who perform well in
one tend to perform well in the other.
Example
• A shopping mall wants to analyze customer footfall data to identify
peak hours on different days. Using a heat map, we can visualize the
intensity of footfall across different time slots for each day.
Compute Correlation Matrix
Example:
•Math values: [78, 56, 90, 45, 70] → Mean = 67.8
•Science values: [85, 65, 88, 50, 75] → Mean = 72.6

•S1: (78–67.8)(85–72.6) = (10.2)(12.4) = 126.48


•S2: (56–67.8)(65–72.6) = (–11.8)(–7.6) = 89.68
•S3: (90–67.8)(88–72.6) = (22.2)(15.4) = 341.88
•S4: (45–67.8)(50–72.6) = (–22.8)(–22.6) = 515.28
•S5: (70–67.8)(75–72.6) = (2.2)(2.4) = 5.28
•Sum = 1,078.6
•Compute denominator:
•√(Σ(Math dev²) × Σ(Science dev²)) = √(1,289.2 × 864.8) = √1,114,905.6 = 1,056.9
•Correlation:
r=1078.61056.9≈0.999r = \frac{1078.6}{1056.9} \approx 0.999r=1056.91078.6​≈0.999
Numerical Example

Student Math Science English CS


S1 78 85 92 88
S2 56 65 72 70
S3 90 88 95 96
S4 45 50 55 58
S5 70 75 78 80
Task:
• Draw a heat map of this dataset (color intensity should represent
marks).
• Highlight which student is the strongest and which is the weakest
overall.
• Identify which subject shows the highest variation in marks.
• Write 2 insights from the heat map (e.g., “S3 performs consistently
high in all subjects” or “S4 is weak in every subject”).
Gantt Chart
• A Gantt Chart is a visual project management tool that represents a
schedule of tasks or activities over time. It is widely used in project
planning to track progress, assign responsibilities, and ensure
deadlines are met.
Task Duration Start Date End Date

Requirement
5 days Day 1 Day 5
Analysis

Design 4 days Day 6 Day 9


Example
Coding 10 days Day 10 Day 19

Testing 6 days Day 20 Day 25

Deployment 2 days Day 26 Day 27


Cont.
Geographical plot
Dr. Chandrashekhar Patel
What is a Geographical Plot?
• A geographical plot (also called a geospatial plot or map
visualization) is a type of data visualization that displays
information on a map. It helps represent data points or
regions according to their geographical location
(latitude and longitude).
Types of Geographical Plot?
• Heat maps showing disease spread or sales density.
• Choropleth maps showing population, income, or
pollution levels by region.
• Scatter maps showing sensor or network node
locations.
Uses of Geographical Plots:
•Environmental Monitoring
•Tracking air pollution, rainfall, or temperature across regions.
•Example: Monitoring CO₂ levels across cities.
•Business and Marketing
•Identifying sales performance or customer density by location.
•Example: Displaying areas with the highest sales in India.
•Public Health and Epidemiology
•Visualizing disease outbreaks or vaccination coverage.
•Example: COVID-19 infection maps.
Uses of Geographical Plots:
•Transportation and Logistics
•Tracking vehicle routes, traffic congestion, or delivery zones.
•Example: Displaying delivery routes on a map for optimization.
•Cybersecurity and Network Analysis
•Showing attack sources or server locations on a world map.
•Example: Mapping global cyberattack origins.
•Urban Planning and Development
•Visualizing land use, water distribution, or population density.
•Example: Planning city infrastructure using demographic maps.
Advantages of Geographical Plots

Advantage Description
Makes complex spatial data visually clear
1. Easy Interpretation
and intuitive.
Helps identify trends, clusters, or hotspots
2. Pattern Detection
easily.
Useful for policy-making, marketing, and
3. Decision Support
resource allocation.
Can visualize live data (e.g., vehicle
4. Real-Time Tracking
movement, disaster alerts).
Works with geographic information systems
5. Integration with GIS
for deep spatial analysis.
Example:
• If you plot the locations of Wi-Fi attacks or IoT
devices across a city using latitude and longitude data,
you can:
• Identify attack-prone zones (useful for cybersecurity
response),
• Allocate security resources effectively,
Choropleth Map
Dr. Chandrashekhar Patel
What is a Choropleth Map?
• A choropleth map is a thematic map that uses
shading, coloring, or patterning of predefined
regions (like countries, states, districts, or zip codes) to
represent statistical values.
• It’s a form of spatial data visualization, meaning it
combines numerical data with geographical
boundaries.
Each area is assigned a color intensity or hue based
on a data variable, which can be:
• Quantitative (e.g., population density, income, rainfall)
• Qualitative (e.g., political affiliation, development
level)
Components of a Choropleth Map

Component Description
The map’s shape file, containing the borders of
Geographical Boundaries (Geometry) regions (e.g., India states shapefile, world country
shapefile).
Numerical data related to each region (e.g.,
Statistical Data (Attributes)
literacy rate per state).
Links each region’s boundary (geometry) to its
Mapping Function corresponding data value (using region names,
IDs, or codes).
Converts numerical ranges into color gradients
Color Scale / Legend
for easy interpretation.
Mathematical & Data Processing
Concepts
Colour Mapping Function
Applications

Domain Example
Disease spread (e.g., dengue or COVID-19
Public Health
cases).
GDP, unemployment, or income levels by
Economics
region.
Cybersecurity Global cyberattack source distribution.
Environment Rainfall, AQI, temperature variations.
Literacy rates or school enrollment by
Education
district.
Advantages
• High Data Density Visualization: Displays complex
spatial patterns efficiently.
• Supports Decision Making: Regional differences become
instantly visible.
• Integrates with Real-Time Dashboards: Works with live
data APIs.
• GIS Compatibility: Works within larger geospatial
analysis workflows.
State COVID Cases

A 100

B 500
Example:
C 800

D 200

E 50
Cont.
• When we make a choropleth map:
• State E (50) — will be light color (low value)
• State A (100) — slightly darker
• State D (200) — a bit darker
• State B (500) — darker shade
• State C (800) — darkest color (highest value)
• So, by just looking at the colors, you can easily see
which areas have higher or lower values.
Example: Literacy Rate in 5 States

State Population Literate People


A 1000 800
B 2000 1200
C 1500 900
D 500 400
E 2500 2000
Calculate Literacy Rate (%)
Let’s make 3 color groups:

Literacy Rate Color


0–59% Light color
60–79% Medium color
80–100% Dark color
State Literacy Rate (%) Map Color
A 80 Dark
B 60 Medium
C 60 Medium
D 80 Dark
E 80 Dark
Example Region Population Cases
Alpha 1,200,000 3,600
Beta 800,000 2,400
Gamma 500,000 1,250
• Let’s take the Alpha,
Beta, Gamma, Delta, Delta 2,500,000 10,000
Epsilon, and Zeta
example (the one with Epsilon 150,000 450
population and cases) Zeta 60,000 90
Cont.
• Using 4 classes, equal intervals for our sample:
• Min = 150, Max = 400 → range = 400 − 150 = 250.
• Interval width = 250 ÷ 4 = 62.5 → bins:
• 150.0 — 212.5
• 212.5 — 275.0
• 275.0 — 337.5
• 337.5 — 400.0
• Assigning:
• Zeta (150) → class 1
• Gamma (250) → class 2
• Alpha/Beta/Epsilon (300) → class 3
• Delta (400) → class 4
• Using quantiles (6 values: 150,250,300,300,300,400) you'd typically place bottom 25% in Q1, next 25% in Q2, etc.
Practical result here:
• Q1: 150
• Q2: 250
• Q3: 300
• Q4: 400
(quantile bins are often implemented by library and handle ties automatically)
Cont.

Region Calculation Rate per 100k


(3600 ÷ 1,200,000) ×
Alpha 300
100,000
(2400 ÷ 800,000) ×
Beta 300
100,000
(1250 ÷ 500,000) ×
Gamma 250
100,000
(10,000 ÷ 2,500,000) ×
Delta 400
100,000
Epsilon (450 ÷ 150,000) × 100,000 300

Zeta (90 ÷ 60,000) × 100,000 150


Bubble Chart
Dr. Chandrashekhar Patel
Bubble chart

• A bubble chart (aka bubble plot) is an extension of


the scatter plot used to look at relationships between
three numeric variables.
• Each dot in a bubble chart corresponds with a single
data point, and the variables’ values for each point are
indicated by horizontal position, vertical position, and
dot size.
Example
• The example bubble chart above depicts the points scored
per game by teams in the regular season of the National
Football League in 2018. Each bubble represents a single
team’s performance. A bubble’s horizontal position notes
the average points scored against that team each game,
and the vertical position notes the average points scored by
that team each game. Each bubble’s size indicates the
number of wins earned by each team, with larger bubbles
corresponding to higher win rates. (Ties are worth half a
win.)
• Think of one bubble = one team. Its position on the chart
tells you two things:
• Horizontal position (X-axis) → Average points scored
against the team.
• Suppose we have Team Eagles:
• They score 28 points per game on average.
• Their opponents score 20 points per game on
average.
• On the bubble chart:
• X-axis: 20 → move 20 units to the right.
• Y-axis: 28 → move 28 units up.
• So the bubble representing the Eagles will be placed at
(20, 28) on the chart.
Observation:
• Higher on the chart → team scores more points.
• Further left → team allows fewer points.
• So the upper-left region is the “best” area: scoring a lot
while allowing few points.
Observations:
•Correlation between points scored and points allowed
•There isn’t a strong correlation between points scored and points allowed.
•Example:
•Team A scores 30 points per game but allows 28 points → not necessarily winning many games.
•Team B scores 28 points per game but allows only 15 points → could win more games.
•This shows that just scoring more doesn’t guarantee wins; defense matters too.
•Effect on wins (bubble size)
•The largest bubbles tend to appear in the upper-left region of the chart: high points scored, low points
allowed.
•Example:
•Suppose Team C scores 35 points/game (high) and allows only 18 points/game (low). Its bubble is large
→ lots of wins.
•Team D scores 18 points/game and allows 30 points/game. Its bubble is small → fewer wins.
• From the plot, we can see that there is a lot more
variance in points scored by teams than by their
opponents, but there’s no particularly strong correlation
between the two. Instead, the main takeaway from the
plot comes from the third variable: as teams score more
points and allow fewer points from their opponents
(towards the upper left), they will earn more victories,
as one might naturally expect.
Startup Marketing Spend Revenue Growth Profit Margin
Alpha 40 70 10
Beta 60 90 20
Gamma 30 50 5
Delta 80 100 25
Key Terms:
• Computing “Revenue Growth per unit of Marketing
Spend” is basically measuring how efficiently each
rupee spent on marketing generates revenue growth.
• It shows which startup/department/campaign is using its
marketing budget more effectively.
• Example:
• Startup A → ₹40 spent → 70% growth → 1.75 growth per unit
spend
• Startup B → ₹60 spent → 90% growth → 1.50 growth per unit
spend
• Startup A is more efficient even though Startup B has
higher growth in absolute terms.
• ROI is used to measure the effectiveness of marketing
spend in generating profits.
• Step 3: Ranking by ROI
• Delta = 31.25 → Best ROI
• Beta = 30.0 → Close second
• Alpha = 17.5
• Gamma = 8.33
Insights from Bubble Chart

• If we use Profit Margin (%) as bubble size → Delta


looks strongest because of high revenue growth &
margin.
• If we switch to ROI as bubble size → Delta & Beta
dominate, while Gamma looks weakest.
• This shows how redefining bubble size changes the
narrative.
Suppose you work for a retail company, and you're building a data warehouse to analyze
customer purchase data. The raw data you receive comes from multiple sources, such as
online purchases, in-store transactions, and customer surveys. However, the data is messy and
needs to be cleansed before loading into the data warehouse.
Raw Data Example

Customer Purchase
Name Amount Email Address
ID Date

123 Main St,


001 John Smith 2024/09/01 150 john@[Link]
NY

456 Elm St,


002 Jane Doe 01-09-2024 $250 [Link]@[Link]
NY

789 Pine St,


003 jake_doe 2024/09/02 -50 N/A
NY

[Link]@[Link] 123 Main St,


004 John Smith 09/01/2024 150
m NY

123 Maple
005 NULL 2024/09/01 200
St, NY

006 Alice Brown 2024/09/03 180 alice#[Link] NULL

Data Cleansing Steps


1. Data Validation
 Incorrect Date Formats: The "Purchase Date" column has different formats (e.g.,
"2024/09/01", "01-09-2024", "09/01/2024"). These need to be standardized to a
consistent format, such as "YYYY-MM-DD".
 Negative Values: The "Amount" column has a negative value (-50), which might be
an error.
2. Data Transformation
 Standardizing Date Formats: Convert all dates to the format "YYYY-MM-DD".
For example, change "01-09-2024" and "09/01/2024" to "2024-09-01".
 Currency Formatting: Remove the dollar sign from the "Amount" column to ensure
that all values are numerical.
3. Error Correction
 Negative Amounts: Investigate and correct the negative value in the "Amount"
column. It might be a refund, which needs to be recorded differently.
 Email Address Format: The email "alice#[Link]" contains a special character
(#) instead of "@" and should be corrected to "alice@[Link]".
4. Duplicate Removal
 Duplicate Records: Rows 1 and 4 are duplicates, representing the same purchase by
"John Smith". One of them should be removed.
5. Handling Missing Data
 Missing Name and Email: For Customer ID 005, the "Name" and "Email" fields are
missing. Depending on the context, you might fill in these details if available or flag
the record for review.
6. Data Enrichment
 Missing Address: The "Address" for Customer ID 006 is missing. You could enrich
this data by looking up additional information if available, such as using a customer
database or CRM system.
Cleansed Data Example

Customer Purchase
Name Amount Email Address
ID Date

123 Main St,


001 John Smith 2024-09-01 150 john@[Link]
NY

002 Jane Doe 2024-09-01 250 [Link]@[Link] 456 Elm St, NY

003 Jake Doe 2024-09-02 50 789 Pine St, NY

123 Maple St,


005 NULL 2024-09-01 200
NY

Alice
006 2024-09-03 180 alice@[Link] NULL
Brown

Key Outcomes
1. Standardized Data: Dates and currency are now consistent, making it easier to
perform analysis.
2. Error-Free: Negative amounts have been corrected, and email formatting errors
fixed.
3. De-duplicated Records: Removing duplicates ensures no skewed analysis.
4. Enriched Data: Missing values have been handled appropriately, improving the
overall quality.
Why This Matters
Cleansing the data ensures that when you load it into the data warehouse, you have accurate,
reliable information to base your decisions on. Without cleansing, analysis could lead to
incorrect conclusions, potentially affecting business strategy.
Data Pre -processing
Data Transformation
• Data Transformation is a process in data mining
where raw data is transformed into an appropriate
format or structure for analysis.
• This process includes various operations that modify the
format, structure, or values of data, making it more
suitable for further processing and analysis.
Common forms of data
transformation include:
•Normalization/Scaling: Adjusting the range of numerical data.

•Aggregation: Summarizing or combining data (e.g., taking an average).

•Encoding: Converting categorical data into numerical form.

•Smoothing: Removing noise from data by averaging.


Example of Data Transformation
• Let's consider normalization, one of the most common
types of transformation, which ensures that data values
are within a specific range, typically between 0 and 1.

• Normalization is important when dealing with features


of different scales.
Importance
• K-Nearest Neighbors (KNN):This algorithm calculates the
distance between points. If one feature has a large
range (e.g., Salary), it will dominate the distance
calculation, and Age will have little influence unless
scaled.
Data Discretization(Bining)
• Data Discretization, also known as Binning, is the
process of converting continuous data into discrete
intervals or categories.
• In data mining and machine learning, this is often done
to make the data easier to analyze or model by
reducing the number of distinct values that a
continuous feature can take.
Example
• Imagine you have the ages of 8 people and you want to
group them into categories such as Child, Teen, Adult,
and Senior. The goal is to transform continuous age
values into understandable categories.
Dashboard
Dr. Chandrashekhar Patel
Defination
• A dashboard is an interactive visual interface that
presents real-time or summarized data using charts,
graphs, and indicators to help users track
performance metrics, trends, and insights related
to specific objectives.
Key Features of a
Dashboard

• Data Visualization: Uses charts,


graphs, maps, and tables to
present data.
• Real-Time Monitoring: Displays live
or regularly updated data.
• Interactivity: Allows filtering,
drilling down, or exploring specific
data points.
• Performance Tracking: Shows KPIs
(Key Performance Indicators) and
metrics.
• Decision Support: Helps identify
problems, trends, and
opportunities quickly.
Types of Dashboards
• Operational Dashboard: Monitors daily operations.
• Example: Server uptime, production rate, IoT sensor
data.
• Analytical Dashboard: Used for deeper data analysis
and comparisons.
• Example: Sales trends by region, performance over
time.
• Strategic Dashboard: Focuses on long-term
organizational goals.
• Example: Business growth KPIs, market share, financial
health.
Dashboard Architecture
• Dashboard Architecture refers to the overall design
and structure of how a dashboard collects, processes,
stores, and visualizes data for users. It defines the flow
of data — from data sources to the visualization layer —
ensuring that information is presented in an interactive,
real-time, and meaningful way.
Data Source Layer
• Examples of data sources:
• Databases (MySQL, PostgreSQL, MongoDB)
• Cloud storage (AWS, Azure, Google Cloud)
• APIs (IoT sensors, web services, etc.)
• Flat files (CSV, Excel, JSON)
• Real-time data streams (Kafka, MQTT)
Data Integration / ETL Layer
• This layer handles Extracting, Transforming, and
Loading (ETL) data to make it usable.
• Functions:
• Data cleaning and preprocessing
• Filtering and aggregation
• Combining data from multiple sources
• Scheduling automatic data refresh
Data Storage Layer
• This layer stores the processed and structured data
ready for visualization.
• Options:
• Data warehouses (Snowflake, Amazon Redshift, Google
BigQuery)
• Datamarts or relational databases
• In-memory databases (Redis) for real-time dashboards
Analytics / Business Logic Layer
• Applies business rules, KPIs, and analytical models to
generate insights.
• Tasks:
• KPI calculations
• Statistical analysis
• Predictive models (AI/ML integration)
• Role-based access rules
Visualization / Presentation Layer
• This is the front-end that the user interacts with — the
actual dashboard UI.
• Key features:
• Charts, graphs, and tables
• Filters and drill-down options
• Real-time updates
• Customizable widgets
Security & Access Layer
• Manages user authentication and data protection.
• Includes:
• Role-based access control
• Data encryption
• API security
• Audit logs
Feedback / Monitoring Layer

• Monitors dashboard performance and user engagement.


• Metrics tracked:
• Dashboard load time
• Data refresh success/failure
• User activity logs
• Error reports

You might also like