购物篮分析:

Apriori算法:

参数设置:

1.car 如果设为真,则会挖掘类关联规则而不是全局关联规则。

2. classindex 类属性索引。如果设置为-1,最后的属性被当做类属性。

3. delta 以此数值为迭代递减单位。不断减小支持度直至达到最小支持度或产生了满足数量要求的规则。

4. lowerBoundMinSupport 最小支持度下界。

5. metricType 度量类型。设置对规则进行排序的度量依据。可以是:置信度(类关联规则只能用置信度挖掘),提升度(lift),杠杆率(leverage),确信度(conviction)。

在 Weka中设置了几个类似置信度(confidence)的度量来衡量规则的关联程度,它们分别是:

a) Lift : P(A,B)/(P(A)P(B)) Lift=1时表示A和B独立。这个数越大(>1),越表明A和B存在于一个购物篮中不是偶然现象,有较强的关联度.

b) Leverage :P(A,B)-P(A)P(B)

Leverage=0时A和B独立,Leverage越大A和B的关系越密切

c) Conviction:P(A)P(!B)/P(A,!B) (!B表示B没有发生) Conviction也是用来衡量A和B的独立性。从它和lift的关系(对B取反,代入Lift公式后求倒数)可以看出,这个值越大, A、B越关联。

6. minMtric 度量的最小值。

7. numRules 要发现的规则数。

8. outputItemSets 如果设置为真,会在结果中输出项集。

9. removeAllMissingCols 移除全部为缺省值的列。

10. significanceLevel 重要程度。重要性测试(仅用于置信度)。

11. upperBoundMinSupport 最小支持度上界。 从这个值开始迭代减小最小支持度。

12. verbose 如果设置为真,则算法会以冗余模式运行。

=== Run information ===

Scheme:       weka.associations.Apriori -N 10 -T 0 -C 0.9 -D 0.05 -U 1.0 -M 0.1 -S -1.0 -c -1
Relation: basket
Instances: 940 // 有940条数据
Attributes: 11 // 有11 个字段
fruitveg
freshmeat
dairy
cannedveg
cannedmeat
frozenmeal
beer
wine
softdrink
fish
confectionery
=== Associator model (full training set) === Apriori
======= Minimum support: 0.1 (94 instances) // 最小支持率是0.1,最小需要94个实例
Minimum metric <confidence>: 0.9 //最小置信度为0.9
Number of cycles performed: 18 // 进行了18轮搜索 Generated sets of large itemsets:  //生成的频繁项集 Size of set of large itemsets L(1): 22 //频繁1项集:22个 Size of set of large itemsets L(2): 171 // 频繁2项集 171 个 Size of set of large itemsets L(3): 633 Size of set of large itemsets L(4): 992 Size of set of large itemsets L(5): 1130 Size of set of large itemsets L(6): 538 Size of set of large itemsets L(7): 143 Best rules found: // 最好的10条规律 1. cannedveg=F beer=F fish=T confectionery=F 118 ==> wine=F 109 conf:(0.92)
2. freshmeat=F cannedveg=F beer=F fish=T confectionery=F 102 ==> wine=F 94 conf:(0.92)
3. fruitveg=F freshmeat=F cannedveg=T softdrink=F 147 ==> dairy=F 135 conf:(0.92)
4. freshmeat=F wine=T confectionery=F 117 ==> dairy=F 107 conf:(0.91)
5. fruitveg=F freshmeat=F cannedveg=T wine=F softdrink=F 105 ==> dairy=F 96 conf:(0.91)
6. fruitveg=F freshmeat=F cannedveg=T softdrink=F confectionery=F 113 ==> dairy=F 103 conf:(0.91)
7. fruitveg=F freshmeat=F cannedveg=T cannedmeat=F softdrink=F 112 ==> dairy=F 102 conf:(0.91)
8. fruitveg=F cannedveg=T softdrink=F confectionery=F 128 ==> dairy=F 116 conf:(0.91)
9. fruitveg=F freshmeat=F cannedveg=T softdrink=F fish=F 117 ==> dairy=F 106 conf:(0.91)
10. fruitveg=F dairy=F cannedveg=T wine=F softdrink=F 106 ==> freshmeat=F 96 conf:(0.91)

结果含义:

cannedveg的值为F、 beer的值F、 fish的值为T 、 confectionery的值为F 118 的时候推出   wine的值为F 109,该关联关系的置信度为0.92
FilteredAssociator
=== Run information ===

Scheme:       weka.associations.FilteredAssociator -F "weka.filters.MultiFilter -F \"weka.filters.unsupervised.attribute.ReplaceMissingValues \"" -c -1 -W weka.associations.Apriori -- -N 10 -T 0 -C 0.9 -D 0.05 -U 1.0 -M 0.1 -S -1.0 -c -1
Relation: basket
Instances: 940
Attributes: 11
fruitveg
freshmeat
dairy
cannedveg
cannedmeat
frozenmeal
beer
wine
softdrink
fish
confectionery
=== Associator model (full training set) === FilteredAssociator using weka.associations.Apriori -N 10 -T 0 -C 0.9 -D 0.05 -U 1.0 -M 0.1 -S -1.0 -c -1 on data filtered through weka.filters.MultiFilter -F "weka.filters.unsupervised.attribute.ReplaceMissingValues " Filtered Header
@relation basket-weka.filters.unsupervised.attribute.ReplaceMissingValues-weka.filters.MultiFilter-Fweka.filters.unsupervised.attribute.ReplaceMissingValues @attribute fruitveg {F,T}
@attribute freshmeat {F,T}
@attribute dairy {F,T}
@attribute cannedveg {F,T}
@attribute cannedmeat {F,T}
@attribute frozenmeal {F,T}
@attribute beer {F,T}
@attribute wine {F,T}
@attribute softdrink {F,T}
@attribute fish {F,T}
@attribute confectionery {F,T} @data Associator Model Apriori
======= Minimum support: 0.1 (94 instances)
Minimum metric <confidence>: 0.9
Number of cycles performed: 18 Generated sets of large itemsets: Size of set of large itemsets L(1): 22 Size of set of large itemsets L(2): 171 Size of set of large itemsets L(3): 633 Size of set of large itemsets L(4): 992 Size of set of large itemsets L(5): 1130 Size of set of large itemsets L(6): 538 Size of set of large itemsets L(7): 143 Best rules found: 1. cannedveg=F beer=F fish=T confectionery=F 118 ==> wine=F 109 conf:(0.92)
2. freshmeat=F cannedveg=F beer=F fish=T confectionery=F 102 ==> wine=F 94 conf:(0.92)
3. fruitveg=F freshmeat=F cannedveg=T softdrink=F 147 ==> dairy=F 135 conf:(0.92)
4. freshmeat=F wine=T confectionery=F 117 ==> dairy=F 107 conf:(0.91)
5. fruitveg=F freshmeat=F cannedveg=T wine=F softdrink=F 105 ==> dairy=F 96 conf:(0.91)
6. fruitveg=F freshmeat=F cannedveg=T softdrink=F confectionery=F 113 ==> dairy=F 103 conf:(0.91)
7. fruitveg=F freshmeat=F cannedveg=T cannedmeat=F softdrink=F 112 ==> dairy=F 102 conf:(0.91)
8. fruitveg=F cannedveg=T softdrink=F confectionery=F 128 ==> dairy=F 116 conf:(0.91)
9. fruitveg=F freshmeat=F cannedveg=T softdrink=F fish=F 117 ==> dairy=F 106 conf:(0.91)
10. fruitveg=F dairy=F cannedveg=T wine=F softdrink=F 106 ==> freshmeat=F 96 conf:(0.91)

这个结论和上面的一样就不写了

Tertius

=== Run information ===

Scheme: weka.associations.Tertius -K 10 -F 0.0 -N 1.0 -L 4 -G 0 -c 0 -I 0 -P 0
Relation: basket
Instances: 940
Attributes: 11
fruitveg
freshmeat
dairy
cannedveg
cannedmeat
frozenmeal
beer
wine
softdrink
fish
confectionery
=== Associator model (full training set) ===

Tertius
=======

1. /* 0.433417 0.022340 */ frozenmeal = F ==> cannedveg = F or beer = F
2. /* 0.427294 0.028723 */ beer = F ==> cannedveg = F or frozenmeal = F
3. /* 0.426433 0.025532 */ cannedveg = F ==> frozenmeal = F or beer = F
4. /* 0.394573 0.015957 */ dairy = F and frozenmeal = T and beer = T ==> cannedveg = T
5. /* 0.388260 0.019149 */ dairy = F and cannedveg = T and beer = T ==> frozenmeal = T
6. /* 0.382993 0.019149 */ beer = F ==> cannedveg = F or frozenmeal = F or softdrink = T
7. /* 0.382471 0.017021 */ frozenmeal = F ==> cannedveg = F or beer = F or softdrink = T
8. /* 0.380465 0.025532 */ dairy = F and cannedveg = T and frozenmeal = T ==> beer = T
9. /* 0.376718 0.017021 */ cannedveg = F ==> frozenmeal = F or beer = F or confectionery = T
10. /* 0.374939 0.018085 */ frozenmeal = F ==> cannedveg = F or beer = F or confectionery = T

Number of hypotheses considered: 43952
Number of hypotheses explored: 22282

结论:

英语版的(英语好的请自己翻译后回复一下):

1. /* 0.433417 0.022340 */ frozenmeal = F ==> cannedveg = F or beer = F

The first number given with the rules is the confirmation value, and the second number is the frequency of counter-instances.
The “number of hypotheses considered” is the number of rules generated with the refinement operator.
The “number of hypotheses explored” is the number of rules that were “potentially interesting” and were considered for adding to the results or refining.

Weka关联规则分析的更多相关文章

  1. (转载)微软数据挖掘算法:Microsoft 关联规则分析算法(7)

    前言 本篇继续我们的微软挖掘算法系列总结,前几篇我们分别介绍了:微软数据挖掘算法:Microsoft 决策树分析算法(1).微软数据挖掘算法:Microsoft 聚类分析算法(2).微软数据挖掘算法: ...

  2. Weka学习之关联规则分析

    步骤: (一) 选择数据源 (二)选择要分析的字段 (三)选择需要的关联规则算法 (四)点击start运行 (五) 分析结果 算法选择: Apriori算法参数含义 1.car:如果设为真,则会挖掘类 ...

  3. 数据挖掘-关联规则分析[ZZ]

    1.什么是关联规则 "尿布与啤酒"的故事大家都有听过,这里就不罗嗦了. 按常规思维,尿布与啤酒风马牛不相及,若不是借助数据挖掘技术对大量交易数据进行挖掘分析,沃尔玛是不可能发现数据 ...

  4. 机器学习理论与实战(十一)关联规则分析Apriori

    <机器学习实战>的最后的两个算法对我来说有点陌生,但学过后感觉蛮好玩,了解了一般的商品数据关联分析和搜索引擎智能提示的工作原理.先来看看关联分析(association analysis) ...

  5. R1(上)—R关联规则分析之Arules包详解

    Arules包详解 包基本信息 发布日期:2014-12-07 题目:挖掘关联规则和频繁项集 描述:提供了一个表达.处理.分析事务数据和模式(频繁项集合关联规则)的基本框架. URL:http://R ...

  6. 【机器学习】关联规则分析(一):Apriori

    一.Apriori原理 Apriori是关联分析中较早的一种方法,主要用来挖掘那些频繁项集合,其思想是: 1.如果一个项目集合不是频繁集合,那么任何包含它的项目(超集)也一定不是频繁集. 2.如果一个 ...

  7. Weka——PrincipalComponents分析

    package weka.filters.unsupervised.attribute; PrincipalComponents 属性: /** The data to transform analy ...

  8. R_Studio(关联)对dvdtrans.csv数据进行关联规则分析

    dvdtrans.csv数据:该原始数据仅仅包含了两个字段(ID, Item) 用户ID,商品名称(共30条) #导入arules包 #install.packages("arules&qu ...

  9. WEKA使用教程(界面工具的用法)

    WEKA使用教程 目录 1. 简介2. 数据格式3.数据准备4. 关联规则(购物篮分析)5. 分类与回归6. 聚类分析 1. 简介 WEKA的全名是怀卡托智能分析环境(Waikato Environm ...

随机推荐

  1. 日志采集客户端 filebeat 安装部署

    linux----------------1. 下载wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.5.1- ...

  2. POJ1655 Balancing Act(树的重心)

    树的重心即树上某结点,删除该结点后形成的森林中包含结点最多的树的结点数最少. 一个DFS就OK了.. #include<cstdio> #include<cstring> #i ...

  3. HNOI2016 游记

    题外 忽然想起去年的HNOI2015总结里好像引了一句诗: 此情可待成追忆,只是当时已惘然. Day0 唔,感觉不知道想些什么,只是觉得其实还没有做好准备,想学的东西学的仓促,想复习的东西,也只能看一 ...

  4. 【NOIP模拟赛】【乱搞AC】【贪心】【模拟】匹配

    匹配 (match.pas/match.c/match.cpp) [题目描述] 到了新的学期,Mcx痛苦的发现通用技术课居然是有实验课的,这样的话他就不得不放弃写作业的想法而去做一件类似于搭积木的事情 ...

  5. 细说JavaScript对象(1):对象的使用和属性

    JavaScript 中的一切都可以视为对象,除了两个特例:null 和 undefined. false.toString(); // 'false' [1, 2, 3].toString(); / ...

  6. ASIHTTPRequest框架使用总结系列之阿堂教程1(安装配置篇

    在前年,阿堂在<IOS开发系列之阿堂教程:玩转IPhone客户端和Web服务端交互(客户端)实践>一文中,对于ASIHTTPRequest框架有过一些介简单绍,具体链接地址见http:// ...

  7. Java HashMap工作原理深入探讨

    大部分Java开发者都在使用Map,特别是HashMap.HashMap是一种简单但强大的方式去存储和获取数据.但有多少开发者知道HashMap内部如何工作呢?几天前,我阅读了java.util.Ha ...

  8. Solr 6.6.0 ERROR: Port 8983 is already being used by another process.

    在目录D:\work\Solr\solr-6.6.0\bin下打开命令框: 输入:solr -e dih报错:ERROR: Port 8983 is already being used by ano ...

  9. Linux Barrier I/O 实现分析与barrier内存屏蔽 总结

    一直以来.I/O顺序问题一直困扰着我.事实上这个问题是一个比較综合的问题,它涉及的层次比較多,从VFS page cache到I/O调度算法,从i/o子系统到存储外设.而Linux I/O barri ...

  10. Tomcat 高性能实现关键点

    我在这里给大家讲解下Tomcat架构设计的几个关键要素,重点从性能及高可用等几个方面来讲解: 1.技术选型 (1) BIO方式适用于连接数目比较小且固定的架构,这种方式对服务器资源要求比较高,并发局限 ...