69
Business Data Analytics Lecture 2 Descriptive analysis and visualization MTAT.03.319

Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Business Data Analytics

Lecture 2Descriptive analysis and visualization

MTAT.03.319

Page 2: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people
Page 3: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Lecture 2:

Descriptive analysis

and visualization

Page 4: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

“about 1/5 of business decision-makers

don’t really understand what big data is

or still believe that big data is

a lot of hype’’ source: Forrester’s Global Business Technographics Data And Analytics Survey, 2015

Page 5: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

many business decisions remain based on

intuitive hunches, not facts

source: Forrester’s Global Business Technographics Data And Analytics Survey, 2015

Informative business decisions

vs. intuition

Page 6: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

many business decisions remain based on

intuitive hunches, not facts

source: Forrester’s Global Business Technographics Data And Analytics Survey, 2015

analytics helps to reduce the gap between intuition

and factual decision-making

shape left: 42 pt x 42 pt

shape right: 42 pt x 42 pt

Informative business decisions

vs. intuition

Page 7: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

many business decisions remain based on

intuitive hunches, not facts

analytics helps to reduce the gap between intuition

and factual decision-making

sophisticated data usage brings competitive gains

image source: making of mass effect andromeda on behance

Informative business decisions

vs. intuition

Page 8: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

many business decisions remain based on

intuitive hunches, not facts

analytics helps to reduce the gap between intuition

and factual decision-making

sophisticated data usage brings competitive gains

data does not speak for itself. it should be analyzed

to take full advantage of its potential

source: Forrester’s Global Business Technographics Data And Analytics Survey, 2015

Informative business decisions

vs. intuition

Page 9: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Data is not yet knowledge

Data -> Information -> Knowledge -> Decision

Page 10: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Informationcollect

clean organize

summarize filter

analyze

Data

Knowledge

action

decision

making

Decision

Page 11: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Usable data is

clean consistent

currentcomprehensive

Page 12: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Most common risks

“Our customer data is a mess.

We know we could be doing more with it.

Being smarter...”

source: custora.com

"We already have some great insights, but we’re too

busy

(and to be perfectly honest, too disorganized)

to actually use them...”

Page 13: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Most common risks

Organization will not have the expertise to use the tools

Organization will not have the expertise of concepts and techniques

Business people will not understand how to obtain business values out of BA

Page 14: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Course agenda

1. Introduction

2. Tools: descriptive analysis and visualization

3. …

Page 15: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Course information

all the relevant information appears on courses webpage:

https://courses.cs.ut.ee/2018/bda/spring

next week homework:

https://courses.cs.ut.ee/2018/bda/spring/Main/Homework1

use discussion board!

Page 16: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Examples are easy and clean.

Real data is messy.

Page 17: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Analysis: principles

Page 18: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Steps of data analysis

source: R for Data Science

http://r4ds.had.co.nz/introduction.html

Page 19: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Steps of data analysis

source: R for Data Science

http://r4ds.had.co.nz/introduction.html

Page 20: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Descriptive statistics

Explore via

Descriptive Plots

Min. 1st Qu. Median Mean 3rd Qu. Max.

18.72 35.13 51.54 48.60 63.33 77.95

Exploratory phase

Page 21: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

What is tidy datawide format wide format

long format

Page 22: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

What is tidy data

3 principles:

each variable forms a column

each observations forms a row

each type of observational unit forms a table

source: R for Data Science

http://r4ds.had.co.nz/introduction.html

Page 23: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

What is tidy data

3 principles:

each variable forms a column

each observations forms a row

each type of observational unit forms a table

Page 24: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Data types

categorical

binary nominal ordinal

numerical

discrete continuous

Page 25: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people
Page 26: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Central tendency measures:

Variation measures:

Relative measures:

Mean, Mode, Median.

Variance, Standard deviation.

Percentiles

Page 27: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Central tendency measures.

Variation measures.

Relative measures.

Mean, Mode, Median.

Variance, Standard deviation.

Percentiles

computed to provide a ‘center’ around which observations are distributed

describe ‘data spread’ or the distance from the center.

description of relative positions of observations

Page 28: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

The Mode, the Median, and the

Mean

x <- c(4,5,2,5,0,0,4,0,9,3)

mean: 3.2

mode: 0

sort(x): 0 0 0 2 3 4 4 5 5 9

median: 3.5

sum(x)/length(x)

Page 29: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Variance and standard deviation

Page 30: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

The Mode, the Median, and the

Mean

Page 31: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Distributions

Source: http://blog.cloudera.com/blog/2015/12/common-probability-distributions-the-

data-scientists-crib-sheet/

Advance or Fun:

Look in case you miss ESN party

Page 32: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Quartiles, percentiles and IQR

the nth percentile is a value such that n% of the

observations fall at or below it

n%

Page 33: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Quartiles, percentiles and IQR

q0 q1

q2=median

q3 q4

25 50 75

the first quartile, q1, is the value for which 25% of the

observations are smaller and 75% are larger

only 25% of the observations > q3

IQR = Q3 – Q1

Page 34: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Visualization

Page 35: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

A visualization is a graphical representation designed to

enable

exploration, analysis, or communication

Page 36: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

The goal of the visualization

Data exploration

Page 37: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

The goal of the visualization

Conveying the

message

Page 38: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people
Page 39: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

The goal of the visualization

Topic exploration

by the end-user

Page 40: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

http://hint.fm/wind/index.html

Page 41: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

https://www.bloomberg.com/billionaires/

Page 42: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

x y

1: 23.0769 70.3125

2: 24.3590 81.0817

3: 26.9231 90.3125

4: 29.7436 86.8510

5: 31.5385 82.2356

6: 34.3590 76.8510

7: 38.9744 77.6202

8: 42.8205 79.5433

9: 22.3077 63.3894

10: 22.0513 53.3894

11: 24.6154 47.2356

12: 28.7179 41.4663

<truncated>

68: 21.2821 46.4663

69: 27.1795 48.7740

70: 31.0256 49.1587

71: 35.1282 49.5433

72: 40.2564 51.4663

73: 45.8974 53.0048

Page 43: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

x y

1: 23.0769 70.3125

2: 24.3590 81.0817

3: 26.9231 90.3125

4: 29.7436 86.8510

5: 31.5385 82.2356

6: 34.3590 76.8510

7: 38.9744 77.6202

8: 42.8205 79.5433

9: 22.3077 63.3894

10: 22.0513 53.3894

11: 24.6154 47.2356

12: 28.7179 41.4663

<truncated>

68: 21.2821 46.4663

69: 27.1795 48.7740

70: 31.0256 49.1587

71: 35.1282 49.5433

72: 40.2564 51.4663

73: 45.8974 53.0048

x y

Min. :18.72 Min. :33.77

1st Qu.:35.13 1st Qu.:49.16

Median :51.54 Median :55.70

Mean :48.60 Mean :59.43

3rd Qu.:63.33 3rd Qu.:69.16

Max. :77.95 Max. :90.31

> cor(dt$x, dt$y)

[1] -0.005949079

Page 44: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

x y

1: 23.0769 70.3125

2: 24.3590 81.0817

3: 26.9231 90.3125

4: 29.7436 86.8510

5: 31.5385 82.2356

6: 34.3590 76.8510

7: 38.9744 77.6202

8: 42.8205 79.5433

9: 22.3077 63.3894

10: 22.0513 53.3894

11: 24.6154 47.2356

12: 28.7179 41.4663

<truncated>

68: 21.2821 46.4663

69: 27.1795 48.7740

70: 31.0256 49.1587

71: 35.1282 49.5433

72: 40.2564 51.4663

73: 45.8974 53.0048http://robertgrantstats.co.uk/drawmydata.html

Page 45: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Visualization ABCs

histogram density plotbar chart multi-set bar chart

line chart scatter plotboxplot network/graph

http://www.datavizcatalogue.com/

Page 46: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Dataset

A transnational data set which contains all the transactions occurring between

01/12/2010 and 09/12/2011 for a UK-based and registered non-store online retail.

The company mainly sells unique all-occasion gifts.

Many customers of the company are wholesalers.

Page 47: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Dataset

> head(initial_dt)

InvoiceNo StockCode Description Quantity InvoiceDate UnitPrice CustomerID

1: 536365 85123A WHITE HANGING HEART T-LIGHT HOLDER 6 01/12/10 08:26 2.55 17850

2: 536365 71053 WHITE METAL LANTERN 6 01/12/10 08:26 3.39 17850

3: 536365 84406B CREAM CUPID HEARTS COAT HANGER 8 01/12/10 08:26 2.75 17850

4: 536365 84029G KNITTED UNION FLAG HOT WATER BOTTLE 6 01/12/10 08:26 3.39 17850

5: 536365 84029E RED WOOLLY HOTTIE WHITE HEART. 6 01/12/10 08:26 3.39 17850

6: 536365 22752 SET 7 BABUSHKA NESTING BOXES 2 01/12/10 08:26 7.65 17850

Country

1: United Kingdom

2: United Kingdom

3: United Kingdom

4: United Kingdom

5: United Kingdom

6: United Kingdom

Page 48: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Description of one discrete feature that displays counts

Bar chart

Page 49: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Description of one discrete feature that displays counts

Bar chart

2500 transactions

were made

from Spain

Page 50: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Multi-set bar chartDescription of two discrete features that displays counts

Page 51: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Multi-set bar chartDescription of two discrete features that displays counts

USA returns are

exceptionally high

compared to all orders

Page 52: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Description of one continuous feature. Displays general distribution

Histogram

Page 53: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Description of one continuous feature. Displays general distribution

Histogram

Mostly the order

size is 1

Page 54: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Effect of a bin size on histogram

Histogram

Page 55: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Description of one continuous feature. Displays smoothed general distribution

Density

Page 56: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Boxplot

source: Alberto Cairo

Page 57: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

2 continuous features. Usually time series

Line chart

Page 58: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Relationship of 2 continuous features.

Scatter plot

Page 59: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Networknode

edge

Page 60: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Networkhttps://martenveskimae.shinyapps.io/R-packages/

Page 61: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

What is the best way to understand correctly the differences

without reading the numbers?

Length or height

Position Area

Angle/area Line weight

Hue and shade

source: Alberto Cairo

Page 62: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

source: Alberto Cairo

Page 63: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people
Page 64: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

source: Alberto Cairo

Which one is better?

Page 65: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

ggplot2

Page 66: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

ggplot2

Building blocks of a graph include:1. data2. aesthetic mapping (color, position, fill,

shape, linetype, size)3. geometric object (points, lines,

boxplots)4. statistical transformations5. scales6. coordinate system7. position adjustments8. faceting

Page 67: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

ggplot2

ggplot(data = <DATA>) +

<GEOM_FUNCTION>(mapping = aes(<MAPPINGS>))

ggplot(dataset) + geom_histogram(aes(x=Quantity))

Page 68: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

Demo time!

https://courses.cs.ut.ee/2018/bda/spring/Main/Practice

Page 69: Business Data Analytics - ut€¦ · Organization will not have the expertise to use the tools Organization will not have the expertise of concepts and techniques Business people

References

• https://www.rstudio.com/wp-content/uploads/2015/04/ggplot2-cheatsheet.pdf

• http://ggplot2.tidyverse.org/reference/

• The Truthful Art by Alberto Cairo

• http://www.datavizcatalogue.com/