当前位置:文档之家› 数据挖掘导论Iris KDD分析

数据挖掘导论Iris KDD分析

`题目 iris数据集的KDD实验学院名称信息科学与技术学院专业名称计算机科学与技术学生姓名何东升学生学号201413030119 指导教师实习地点成都理工大学实习成绩二〇一六年 9月iris数据集的KDD实验第1章、实验目的及内容1.1 实习目的知识发现(KDD:Knowledge Discovery in Database)是从数据集中识别出有效的、新颖的、潜在有用的,以及最终可理解的模式的非平凡过程。

知识发现将信息变为知识,从数据矿山中找到蕴藏的知识金块,将为知识创新和知识经济的发展作出贡献。

该术语于1989年出现,Fayyad定义为"KDD"是从数据集中识别出有效的、新颖的、潜在有用的,以及最终可理解的模式的非平凡过程”。

KDD的目的是利用所发现的模式解决实际问题,“可被人理解”的模式帮助人们理解模式中包含的信息,从而更好的评估和利用。

1.2 算法的核心思想作为一个KDD的工程而言,KDD通常包含一系列复杂的挖掘步骤.Fayyad,Piatetsky-Shapiro 和Smyth 在1996年合作发布的论文<From Data Mining to knowledge discovery>中总结出了KDD包含的5个最基本步骤(如图).1: selection: 在第一个步骤中我们往往要先知道什么样的数据可以应用于我们的KDD工程中.2: pre-processing: 当采集到数据后,下一步必须要做的事情是对数据进行预处理,尽量消除数据中存在的错误以及缺失信息.3: transformation: 转换数据为数据挖掘工具所需的格式.这一步可以使得结果更加理想化.4: data mining: 应用数据挖掘工具.5:interpretation/ evaluation: 了解以及评估数据挖掘结果.1.3实验软件:Weka3-9.数据集来源:/ml/datasets/Iris第2章、实验过程2.1数据准备1.从uci的数据集官网下载iris的数据源2.抽取数据,清洗数据,变换数据3.iris的数据集如图Iris也称鸢尾花卉数据集,是一类多重变量分析的数据集。

通过花萼长度,花萼宽度,花瓣长度,花瓣宽度4个属性预测鸢尾花卉属于(Setosa,Versicolour,Virginica)三个种类中的哪一类。

2.2 实验过程2.2.1.建模(1)C4.5数据挖掘算法使用weka进行有指导的学习训练,选择C4.5数据挖掘算法,在Weka中名为J48,将test options 设置为 Percentage split ,使用默认百分比66%。

选择class作为输出属性。

如图所示:2.设置完成后点击start开始执行(2)Simple KMeans算法1加载数据到Weka,切换到Cluster选项卡,选择Simple KMeans算法、2.设置算法参数,显示标准差,迭代次数设为5000次,其他默认。

簇数选择3,因为花的种类为3。

如下图所示3.在Cluster Mode 面板选择评估数据为Use trainin set,并单击Ignore attribu,忽略class属性。

4.点击start按钮,执行程序第三章实验结果及分析3.1 C4.5结果分析1.运行结果=== Run information ===Scheme: weka.classifiers.trees.J48 -C 0.25 -M 2Relation: irisInstances: 150Attributes: 5sepal lengthsepal widthpetal lengthpetal widthclassTest mode: split 66.0% train, remainder test=== Classifier model (full training set) ===J48 pruned tree------------------petal width <= 0.6: Iris-setosa (50.0)petal width > 0.6| petal width <= 1.7| | petal length <= 4.9: Iris-versicolor (48.0/1.0)| | petal length > 4.9| | | petal width <= 1.5: Iris-virginica (3.0)| | | petal width > 1.5: Iris-versicolor (3.0/1.0)| petal width > 1.7: Iris-virginica (46.0/1.0)Number of Leaves : 5Size of the tree : 9Time taken to build model: 0.01 seconds=== Evaluation on test split ===Time taken to test model on training split: 0 seconds=== Summary ===Correctly Classified Instances 49 96.0784 %Incorrectly Classified Instances 2 3.9216 %Kappa statistic 0.9408Mean absolute error 0.0396Root mean squared error 0.1579Relative absolute error 8.8979 %Root relative squared error 33.4091 %Total Number of Instances 51=== Detailed Accuracy By Class ===TP Rate FP Rate Precision Recall F-Measure MCC ROC Area PRC Area Class1.000 0.000 1.000 1.000 1.000 1.000 1.000 1.000 Iris-setosa1.000 0.063 0.905 1.000 0.950 0.921 0.969 0.905 Iris-versicolor0.882 0.000 1.000 0.882 0.938 0.913 0.967 0.938 Iris-virginicaWeighted Avg. 0.961 0.023 0.965 0.961 0.961 0.942 0.977 0.944=== Confusion Matrix ===a b c <-- classified as15 0 0 | a = Iris-setosa0 19 0 | b = Iris-versicolor0 2 15 | c = Iris-virginica从上述结果可以看出正确率为96.0784 %所以petal width和petal length 可以很好的判断花的类别。

3.1 Simple KMeans 算法结果=== Run information ===Scheme: weka.clusterers.SimpleKMeans -init 0 -max-candidates 100 -periodic-pruning 10000 -min-density 2.0 -t1 -1.25 -t2 -1.0 -V -N 3 -A "weka.core.EuclideanDistance -R first-last" -I 500 -num-slots 1 -S 10Relation: irisInstances: 150Attributes: 5sepal lengthsepal widthpetal lengthpetal widthIgnored:classTest mode: evaluate on training data=== Clustering model (full training set) ===kMeans======Number of iterations: 6Within cluster sum of squared errors: 6.998114004826762Initial starting points (random):Cluster 0: 6.1,2.9,4.7,1.4Cluster 1: 6.2,2.9,4.3,1.3Cluster 2: 6.9,3.1,5.1,2.3Missing values globally replaced with mean/modeFinal cluster centroids:Cluster#Attribute Full Data 0 1 2(150.0) (61.0) (50.0) (39.0)=========================================================== sepal length 5.8433 5.8885 5.006 6.8462+/-0.8281 +/-0.4487 +/-0.3525 +/-0.5025sepal width 3.054 2.7377 3.418 3.0821+/-0.4336 +/-0.2934 +/-0.381 +/-0.2799petal length 3.7587 4.3967 1.464 5.7026+/-1.7644 +/-0.5269 +/-0.1735 +/-0.5194petal width 1.1987 1.418 0.244 2.0795+/-0.7632 +/-0.2723 +/-0.1072 +/-0.2811Time taken to build model (full training data) : 0 seconds=== Model and evaluation on training set ===Clustered Instances0 61 ( 41%)1 50 ( 33%)2 39 ( 26%)从实验结果可以看出分出的类为3个且比例与元数据的class的比例1:1:1的比例不是很相近。

从C4.5的结果来看pental width和pental length 更加符合,重新选择属性,仅选择pental width和pental length 结果如下=== Run information ===Scheme: weka.clusterers.SimpleKMeans -init 0 -max-candidates 100 -periodic-pruning 10000 -min-density 2.0 -t1 -1.25 -t2 -1.0 -V -N 3 -A "weka.core.EuclideanDistance -R first-last" -I 5009 -num-slots 1 -S 10Relation: irisInstances: 150Attributes: 5petal lengthpetal widthIgnored:sepal lengthsepal widthclassTest mode: evaluate on training data=== Clustering model (full training set) ===kMeans======Number of iterations: 6Within cluster sum of squared errors: 1.7050986081225123Initial starting points (random):Cluster 0: 4.7,1.4Cluster 1: 4.3,1.3Cluster 2: 5.1,2.3Missing values globally replaced with mean/modeFinal cluster centroids:Cluster#Attribute Full Data 0 1 2(150.0) (52.0) (50.0) (48.0)=========================================================== petal length 3.7587 4.2962 1.464 5.5667+/-1.7644 +/-0.5053 +/-0.1735 +/-0.549petal width 1.1987 1.325 0.244 2.0562+/-0.7632 +/-0.1856 +/-0.1072 +/-0.2422Time taken to build model (full training data) : 0.02 seconds=== Model and evaluation on training set ===Clustered Instances0 52 ( 35%)1 50 ( 33%)2 48 ( 32%)从结果可以看出pental width和pental length 能够很好的作为分类的属性值第四章心得体会从这次的作业中学习了KDD以及KDD模型过程的建立。

相关主题