WEKA数据分析实验Word版.docx

上传人:doc321 文档编号:14926083 上传时间:2022-02-24 格式:DOCX 页数:12 大小:223.38KB
返回 下载 相关 举报
WEKA数据分析实验Word版.docx_第1页
第1页 / 共12页
WEKA数据分析实验Word版.docx_第2页
第2页 / 共12页
WEKA数据分析实验Word版.docx_第3页
第3页 / 共12页
WEKA数据分析实验Word版.docx_第4页
第4页 / 共12页
WEKA数据分析实验Word版.docx_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《WEKA数据分析实验Word版.docx》由会员分享,可在线阅读,更多相关《WEKA数据分析实验Word版.docx(12页珍藏版)》请在三一文库上搜索。

1、WEKA 数据分析实验1. 实验简介借助工具Weka 3.6 ,对数据样本进行测试,分类测试方法包括:朴素贝叶斯、决策树、随机数三类,聚类测试方法包括:DBScan,K均值两种;2. 数据样本以熟悉数据分类的各类常用算法,以及了解Weka的使用方法为目的,本次试验中,采用的数据样本是Weka软件自带的“Vote”样本,如图:3. 关联规则 分析1) 操作步骤:a) 点击 “Explorer”按钮,弹出“Weka Explorer”控制界面b) 选择“Associate”选项卡;c) 点击“Choose”按钮,选择“Apriori”规则d) 点击参数文本框框,在参数选项卡设置参数如:1 / 12

2、e) 点击左侧“Start”按钮2) 执行结果:= Run information =Scheme: weka.associations.Apriori -I -N 10 -T 0 -C 0.9 -D 0.05 -U 1.0 -M 0.5 -S -1.0 -c -1Relation: voteInstances: 435Attributes: 17 handicapped-infants water-project-cost-sharing adoption-of-the-budget-resolution physician-fee-freeze el-salvador-aid religi

3、ous-groups-in-schools anti-satellite-test-ban aid-to-nicaraguan-contras mx-missile immigration synfuels-corporation-cutback education-spending superfund-right-to-sue crime duty-free-exports export-administration-act-south-africa Class= Associator model (full training set) =Apriori=Minimum support: 0

4、.5 (218 instances)Minimum metric : 0.9Number of cycles performed: 10Generated sets of large itemsets:Size of set of large itemsets L(1): 12Large Itemsets L(1):handicapped-infants=n 236adoption-of-the-budget-resolution=y 253physician-fee-freeze=n 247religious-groups-in-schools=y 272anti-satellite-tes

5、t-ban=y 239aid-to-nicaraguan-contras=y 242synfuels-corporation-cutback=n 264education-spending=n 233crime=y 248duty-free-exports=n 233export-administration-act-south-africa=y 269Class=democrat 267Size of set of large itemsets L(2): 4Large Itemsets L(2):adoption-of-the-budget-resolution=y physician-f

6、ee-freeze=n 219adoption-of-the-budget-resolution=y Class=democrat 231physician-fee-freeze=n Class=democrat 245aid-to-nicaraguan-contras=y Class=democrat 218Size of set of large itemsets L(3): 1Large Itemsets L(3):adoption-of-the-budget-resolution=y physician-fee-freeze=n Class=democrat 219Best rules

7、 found: 1. adoption-of-the-budget-resolution=y physician-fee-freeze=n 219 = Class=democrat 219 conf:(1) 2. physician-fee-freeze=n 247 = Class=democrat 245 conf:(0.99) 3. adoption-of-the-budget-resolution=y Class=democrat 231 = physician-fee-freeze=n 219 conf:(0.95) 4. Class=democrat 267 = physician-

8、fee-freeze=n 245 conf:(0.92) 5. adoption-of-the-budget-resolution=y 253 = Class=democrat 231 conf:(0.91) 6. aid-to-nicaraguan-contras=y 242 = Class=democrat 218 conf:(0.9)3) 结果分析:a) 该样本数据,数据记录数435个,17个属性,进行了10轮测试b) 最小支持度为0.5,即至少需要218个实例;c) 最小置信度为0.9;d) 进行了10轮搜索,频繁1项集 12个,频繁2项集4个,频繁3项集1个;4. 分类算法-随机树

9、分析1) 操作步骤:a) 点击 “Explorer”按钮,弹出“Weka Explorer”控制界面b) 选择“Classify ”选项卡;c) 点击“Choose”按钮,选择“trees”“RandomTree”规则d) 设置 Cross-validation 为10次e) 点击左侧“Start”按钮2) 执行结果:= Run information =Scheme:weka.classifiers.trees.RandomTree -K 0 -M 1.0 -S 1Relation: voteInstances:435Attributes:17 handicapped-infants wat

10、er-project-cost-sharing adoption-of-the-budget-resolution physician-fee-freeze el-salvador-aid religious-groups-in-schools anti-satellite-test-ban aid-to-nicaraguan-contras mx-missile immigration synfuels-corporation-cutback education-spending superfund-right-to-sue crime duty-free-exports export-ad

11、ministration-act-south-africa ClassTest mode:10-fold cross-validation= Classifier model (full training set) =RandomTree=el-salvador-aid = n| physician-fee-freeze = n| | duty-free-exports = n| | | anti-satellite-test-ban = n| | | | synfuels-corporation-cutback = n| | | | | crime = n : republican (0.9

12、6/0)| | | | | crime = y| | | | | | handicapped-infants = n : democrat (2.02/0.01)| | | | | | handicapped-infants = y : democrat (0.05/0)| | | | synfuels-corporation-cutback = y| | | | | handicapped-infants = n : democrat (0.79/0.01)| | | | | handicapped-infants = y : democrat (2.12/0)| | | anti-sate

13、llite-test-ban = y| | | | adoption-of-the-budget-resolution = n| | | | | handicapped-infants = n : democrat (1.26/0.01)| | | | | handicapped-infants = y : republican (1.25/0.25)| | | | adoption-of-the-budget-resolution = y| | | | | handicapped-infants = n| | | | | | crime = n : democrat (5.94/0.01)|

14、 | | | | | crime = y : democrat (5.15/0.12)| | | | | handicapped-infants = y : democrat (36.99/0.09)| | duty-free-exports = y| | | crime = n : democrat (124.23/0.29)| | | crime = y| | | | handicapped-infants = n : democrat (16.9/0.38)| | | | handicapped-infants = y : democrat (8.99/0.02)| physician-

15、fee-freeze = y| | immigration = n| | | education-spending = n| | | | crime = n : democrat (1.09/0)| | | | crime = y : democrat (1.01/0.01)| | | education-spending = y : republican (1.06/0.02)| | immigration = y| | | synfuels-corporation-cutback = n| | | | religious-groups-in-schools = n : republican

16、 (3.02/0.01)| | | | religious-groups-in-schools = y : republican (1.54/0.04)| | | synfuels-corporation-cutback = y : republican (1.06/0.05)el-salvador-aid = y| synfuels-corporation-cutback = n| | physician-fee-freeze = n| | | handicapped-infants = n| | | | superfund-right-to-sue = n| | | | | crime =

17、 n : democrat (1.36/0)| | | | | crime = y| | | | | | mx-missile = n : republican (1.01/0)| | | | | | mx-missile = y : democrat (1.01/0.01)| | | | superfund-right-to-sue = y : democrat (4.83/0.03)| | | handicapped-infants = y : democrat (8.42/0.02)| | physician-fee-freeze = y| | | adoption-of-the-bud

18、get-resolution = n| | | | export-administration-act-south-africa = n| | | | | mx-missile = n : republican (49.03/0)| | | | | mx-missile = y : democrat (0.11/0)| | | | export-administration-act-south-africa = y| | | | | duty-free-exports = n| | | | | | mx-missile = n : republican (60.67/0)| | | | | |

19、 mx-missile = y : republican (6.21/0.15)| | | | | duty-free-exports = y| | | | | | aid-to-nicaraguan-contras = n| | | | | | | water-project-cost-sharing = n| | | | | | | | mx-missile = n : republican (3.12/0)| | | | | | | | mx-missile = y : democrat (0.01/0)| | | | | | | water-project-cost-sharing =

20、 y : democrat (1.15/0.14)| | | | | | aid-to-nicaraguan-contras = y : republican (0.16/0)| | | adoption-of-the-budget-resolution = y| | | | anti-satellite-test-ban = n| | | | | immigration = n : democrat (2.01/0.01)| | | | | immigration = y| | | | | | water-project-cost-sharing = n| | | | | | | mx-mi

21、ssile = n : republican (1.63/0)| | | | | | | mx-missile = y : republican (1.01/0.01)| | | | | | water-project-cost-sharing = y| | | | | | | superfund-right-to-sue = n : republican (0.45/0)| | | | | | | superfund-right-to-sue = y : republican (1.71/0.64)| | | | anti-satellite-test-ban = y| | | | | mx

22、-missile = n : republican (7.74/0)| | | | | mx-missile = y : republican (4.05/0.03)| synfuels-corporation-cutback = y| | adoption-of-the-budget-resolution = n| | | superfund-right-to-sue = n| | | | anti-satellite-test-ban = n| | | | | physician-fee-freeze = n : democrat (1.39/0.01)| | | | | physicia

23、n-fee-freeze = y| | | | | | water-project-cost-sharing = n : republican (1.01/0)| | | | | | water-project-cost-sharing = y : democrat (1.05/0.05)| | | | anti-satellite-test-ban = y : democrat (1.13/0.01)| | | superfund-right-to-sue = y| | | | education-spending = n| | | | | physician-fee-freeze = n|

24、 | | | | | crime = n : democrat (0.09/0)| | | | | | crime = y| | | | | | | handicapped-infants = n : democrat (1.01/0.01)| | | | | | | handicapped-infants = y : democrat (1/0)| | | | | physician-fee-freeze = y| | | | | | immigration = n| | | | | | | export-administration-act-south-africa = n : democ

25、rat (0.34/0.11)| | | | | | | export-administration-act-south-africa = y| | | | | | | | crime = n : democrat (0.16/0)| | | | | | | | crime = y| | | | | | | | | mx-missile = n| | | | | | | | | | handicapped-infants = n : republican (0.29/0)| | | | | | | | | | handicapped-infants = y : republican (1.88

26、/0.87)| | | | | | | | | mx-missile = y : democrat (0.01/0)| | | | | | immigration = y : republican (1.01/0)| | | | education-spending = y| | | | | physician-fee-freeze = n| | | | | | handicapped-infants = n : democrat (1.51/0.01)| | | | | | handicapped-infants = y : democrat (2.01/0)| | | | | physic

27、ian-fee-freeze = y| | | | | | crime = n : republican (1.02/0)| | | | | | crime = y| | | | | | | export-administration-act-south-africa = n| | | | | | | | handicapped-infants = n| | | | | | | | | immigration = n| | | | | | | | | | mx-missile = n| | | | | | | | | | | water-project-cost-sharing = n : d

28、emocrat (1.01/0.01)| | | | | | | | | | | water-project-cost-sharing = y : republican (1.81/0)| | | | | | | | | | mx-missile = y : democrat (0.01/0)| | | | | | | | | immigration = y| | | | | | | | | | mx-missile = n : republican (2.78/0)| | | | | | | | | | mx-missile = y : democrat (0.01/0)| | | | |

29、| | | handicapped-infants = y| | | | | | | | | mx-missile = n : republican (2/0)| | | | | | | | | mx-missile = y : democrat (0.4/0)| | | | | | | export-administration-act-south-africa = y| | | | | | | | mx-missile = n : republican (8.77/0)| | | | | | | | mx-missile = y : democrat (0.02/0)| | adoptio

30、n-of-the-budget-resolution = y| | | anti-satellite-test-ban = n| | | | handicapped-infants = n| | | | | crime = n : democrat (2.52/0.01)| | | | | crime = y : democrat (7.65/0.07)| | | | handicapped-infants = y : democrat (10.83/0.02)| | | anti-satellite-test-ban = y| | | | physician-fee-freeze = n|

31、| | | | handicapped-infants = n| | | | | | crime = n : democrat (2.42/0.01)| | | | | | crime = y : democrat (2.28/0.03)| | | | | handicapped-infants = y : democrat (4.17/0.01)| | | | physician-fee-freeze = y| | | | | mx-missile = n : republican (2.3/0)| | | | | mx-missile = y : democrat (0.01/0)Size

32、 of the tree : 143Time taken to build model: 0.01seconds= Stratified cross-validation = Summary =Correctly Classified Instances 407 93.5632 %Incorrectly Classified Instances 28 6.4368 %Kappa statistic 0.8636Mean absolute error 0.0699Root mean squared error 0.2379Relative absolute error 14.7341 %Root

33、 relative squared error 48.8605 %Total Number of Instances 435 = Detailed Accuracy By Class = TP Rate FP Rate Precision Recall F-Measure ROC Area Class 0.955 0.095 0.941 0.955 0.948 0.966 democrat 0.905 0.045 0.927 0.905 0.916 0.967 republicanWeighted Avg. 0.936 0.076 0.936 0.936 0.935 0.966= Confus

34、ion Matrix = a b - classified as 255 12 | a = democrat 16 152 | b = republican3) 结果分析:a) 该样本数据,数据记录数435个,17个属性,进行了10轮交叉验证b) 随机树长 143c) 正确分类共 407个,正确率达 93.5632 %d) 错误分类28个,错误率 6.4368 %e) 测试数据的正确率较好5. 分类算法-随机树 分析1) 操作步骤:a) 点击 “Explorer”按钮,弹出“Weka Explorer”控制界面b) 选择“Classify ”选项卡;c) 点击“Choose”按钮,选择“tre

35、es”“J48”规则d) 设置 Cross-validation 为10次e) 点击左侧“Start”按钮2) 执行结果:= Run information =Scheme:weka.classifiers.trees.J48 -C 0.25 -M 2Relation: voteInstances:435Attributes:17 handicapped-infants water-project-cost-sharing adoption-of-the-budget-resolution physician-fee-freeze el-salvador-aid religious-group

36、s-in-schools anti-satellite-test-ban aid-to-nicaraguan-contras mx-missile immigration synfuels-corporation-cutback education-spending superfund-right-to-sue crime duty-free-exports export-administration-act-south-africa ClassTest mode:10-fold cross-validation= Classifier model (full training set) =J

37、48 pruned tree-physician-fee-freeze = n: democrat (253.41/3.75)physician-fee-freeze = y| synfuels-corporation-cutback = n: republican (145.71/4.0)| synfuels-corporation-cutback = y| | mx-missile = n| | | adoption-of-the-budget-resolution = n: republican (22.61/3.32)| | | adoption-of-the-budget-resol

38、ution = y| | | | anti-satellite-test-ban = n: democrat (5.04/0.02)| | | | anti-satellite-test-ban = y: republican (2.21)| | mx-missile = y: democrat (6.03/1.03)Number of Leaves : 6Size of the tree : 11Time taken to build model: 0.06seconds= Stratified cross-validation = Summary =Correctly Classified Instances 419 96.3218 %Incorrectly Classified Instances 16 3.6782 %Kappa statistic 0.9224Mean absolu

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

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1