hw1.docx

上传人:b****4 文档编号:4308005 上传时间:2022-11-29 格式:DOCX 页数:13 大小:246.92KB
下载 相关 举报
hw1.docx_第1页
第1页 / 共13页
hw1.docx_第2页
第2页 / 共13页
hw1.docx_第3页
第3页 / 共13页
hw1.docx_第4页
第4页 / 共13页
hw1.docx_第5页
第5页 / 共13页
点击查看更多>>
下载资源
资源描述

hw1.docx

《hw1.docx》由会员分享,可在线阅读,更多相关《hw1.docx(13页珍藏版)》请在冰豆网上搜索。

hw1.docx

hw1

PartI:

书面作业

1.(a)

date_key

product_key

vendor_key

location_key

sales_volume

sales_cost

dateproduct

date_key

day

day_of_the_week

month

quarter

year

product_key

product_name

brand

type

supplier_type

salesfacttable

vendor_key

vendor_name

vendor_type

location

Location_key

Street

City

Province_or_state

country

vendor

 

measures

(b)OLAP操作:

①切片slice:

location=”LosAngles”

②上卷roll-up:

从季度(月)到年

③读取度量sales_volume

(c)优点:

对于数据立方体,利用多维数组可以很容易实现位图索引,对维成员进行编码,代替维表中的原关键字,实现维关键字的压缩,减少了I/O访问开销,提高了查询效率。

问题:

使用位图索引大大地增加了空间的使用量。

2.

(a)age:

mean=46.44

median=51

standarddeviation=23.15

fat:

mean=28.78

median=30.7

standarddeviation=85.64

(b)boxplots:

(c)scatterplot:

(d)min-maxnormalization:

让age和fat的范围映射到[0.0,1.0]之间,得到:

age

0

0

0.1053

0.1053

0.4211

0.4737

0.6316

0.6842

0.7105

%fat

0.0490

0.5389

0

0.2882

0.6801

0.5216

0.5648

0.5591

0.6744

age

0.7632

0.8158

0.8158

0.8684

0.8947

0.9211

0.9211

0.9737

1.0000

%fat

0.7723

1.0000

0.6052

0.7378

0.6455

0.7579

0.7233

0.9625

0.8040

(e)correlationcoefficient:

,说明年龄与脂肪量是正相关的。

3.

Equal-depth:

Bin1

16

16

17

18

19

Bin2

20

20

20

21

21

Bin3

22

22

23

23

24

Bin4

24

25

26

26

27

(a)binmedian

Bin1

17

17

17

17

17

Bin2

20

20

20

20

20

Bin3

23

23

23

23

23

Bin4

26

26

26

26

26

(b)binboundaries:

Bin1

16

16

16

19

19

Bin2

20

20

20

21

21

Bin3

22

22

22

24

24

Bin4

24

24

27

27

27

项集

支持度计数

A

1

C

2

D

1

E

4

I

1

K

5

M

1

N

1

O

4

U

1

Y

1

项集

支持度计数

C

2

E

4

K

5

O

4

4.(a)apriori:

候选的支持度计数与最小支持度计数比较,得L1

扫描D,对每个候选计数,得到C1

 

项集

支持度计数

CE

1

CK

2

CO

1

EK

4

EO

4

KO

4

项集

支持度计数

CK

2

EK

4

EO

4

KO

4

由L2连接L2得候选3项集C3,同时进行剪枝操作。

扫描D,对每个候选计数

候选的支持度计数与最小支持度计数比较,得L2

由L1连接L1得候选2项集C2,扫描D,对每个候选计数

 

项集

支持度计数

EKO

4

项集

支持度计数

EKO

4

候选的支持度计数与最小支持度计数比较,得L3,算法终止,得到所有的频繁项集

所有的频繁项集L={{C},{E},{K},{O},{CK},{EK},{EO},{KO},{EKO}}。

(b)FP-growth:

第一次扫描结果与apriori算法相同,频繁项集按递减顺序排序,L={{K:

5},{E:

4},{O:

4},{C:

2}}。

TID

items_bought

(ordered)frequentitems

1

O,N,K,E

{K,E,O}

2

D,O,K,E,Y

{K,E,O}

3

A,K,E,O

{K,E,O}

4

M,U,C,K

{K}

5

C,O,K,I,E

{K,E,O,C}

 

FP-trees:

 

items

conditionalpatternbases

conditionalFP-trees

frequentpatterns

C

{{K,E,O:

1},{K:

1}}

2>

{KEOC,KC}

O

{{K,E:

4}}

4,E:

4>

{KEO}

E

{{K:

4}}

4>

{KE}

所有的频繁项集L={{C},{E},{K},{O},{CK},{EK},{EO},{KO},{EKO}}。

 

5.

(a)confidence(K=>E)=80%

confidence(K=>O)=80%

confidence(E=>O)=100%

(b)strongassociationrules:

PartII:

上机作业:

RecommendationSystems

top5rules:

tomatosoucemilk

tomatosouce

rice

biscuitswater

yoghurtpasta

comments:

交易提升最大的是番茄汁牛奶、番茄汁、米饭、饼干水、酸奶意面;

不过其中交易数量真正较大的只有番茄汁;

容易与其他产品一起购买的有番茄汁牛奶、饼干水和酸奶意面。

top5rules:

biscuits

yoghurt

tomatosouce

waterpasta

juices

comments:

支持度最高的分别是饼干、酸奶、番茄汁、意面、果汁;

置信度和提升度都比较稳定。

top5rules:

biscuitswater

yoghurtpasta

biscuitspasta

briochespasta

tomatosoucemilk

comments:

置信度最高的是饼干水、酸奶意面、饼干意面、奶油蛋卷意面和番茄汁牛奶,这些商品容易与其他商品一起购买;

不过这几种商品本身的购买数量并不多。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1