Efficient Pattern Mining Methods

2024-01-27 20:30

本文主要是介绍Efficient Pattern Mining Methods,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Efficient Pattern Mining Methods

@(Pattern Discovery in Data Mining)
本文介绍了几个模式挖掘的高效算法。主要以Apriori思想为框架,主要讲解了FP-Growth算法。

The Downward Closure Property of Frequent Patterns

  1. Property
    The downward closure (also called “Apriori”) property of frequent patterns:

    • If {beer, diaper, nuts} is frequent, so is {beer, diaper}
    • Every transaction containing {beer, diaper, nuts} also contains {beer, diaper}
    • Apriori: Any subset of a frequent itemset must be frequent
  2. Efficient mining methodology

    • If any subset of an itemset S is infrequent, then there is no chance for S to
      be frequent — why do we even have to consider S!? (It is an efficient way to prune)
  3. Principle
    Apriori pruning principle: If there is any itemset which is infrequent, its superset should not even be generated! (Agrawal & Srikant @VLDB’94, Mannila, et al. @ KDD’ 94)

  4. Scalable mining Methods

    • Level-wise, join-based approach: Apriori (Agrawal &Srikant@VLDB’94)
    • Vertical data format approach: Eclat (Zaki, Parthasarathy, Ogihara, Li @KDD’97)
    • Frequent pattern projection and growth: FPgrowth (Han, Pei, Yin @SIGMOD’00)

The Apriori Algorithm

  1. Outline of Apriori (level-wise, candidate generation and test)

    • Initially, scan DB once to get frequent 1-itemset
    • Repeat
      • Generate length-(k+1) candidate itemsets from length-k frequent itemsets
      • Test the candidates against DB to find frequent (k+1)-itemsets
      • Set k := k +1
    • Until no frequent or candidate set can be generated
    • Return all the frequent itemsets derived
  2. Psuedo Code

  3. Tricks
    joining & pruning



这里,对于某此迭代产生的joining结果,检验任何一个k-1的子集是否在候选集 Ck 中。即上图pruning的过程。

Extensions or Improvements of Apriori

  • Reduce passes of transaction database scans
    • Partitioning (e.g., Savasere, et al., 1995)
    • Dynamic itemset counting (Brin, et al., 1997) —> one of Google’s cofounder
  • Shrink the number of candidates
    • Hashing (e.g., DHP: Park, et al., 1995)
    • Pruning by support lower bounding (e.g., Bayardo 1998)  Sampling (e.g., Toivonen, 1996)
  • Exploring special data structures
    • Tree projection (Aggarwal, et al., 2001)
    • H-miner (Pei, et al., 2001)
    • Hypecube decomposition (e.g., LCM: Uno, et al., 2004)

Mining Frequent Patterns by Exploring Vertical Data Format

FPGrowth: A Frequent Pattern-Growth Approach

  1. 构造FP-Tree,快速迭代生成frequent patterns
    什么是FP-Tree?如何构造FP-Tree?
    • 计算每个single itemset的frequency
    • 将每个个Transaction中item的根据frequency进行排序
    • 类似于前缀树,生成FP-Tree,其中每个节点代表了一个item

生成结果如下所示:

  1. 生成Frequent Itemset
    利用分治的方法进行迭代计算。
    过程(设min_sup=2,以e后缀为例):
    1)得到e的前缀路径子树

    2)计算e的频数,判断e是否是frequent item。方法是遍历e节点的链表(虚线连接)计算节点数目,得sup(e)=3 > 2,所以继续下述步骤。
    3)因为e是频繁的,找到所有以e结尾的frequent itemlist,也就是说,分拆问题,进行迭代。
    这里我们首先需要拿到e的Conditional FP-Tree。
    4)Conditional FP-Tree的生成:
    结果:比较挫,直接看图

    步骤:
    1 - 更新e的前缀路径子树中的support值

    2 - 删除包含e的节点

    3 - 删除不频繁(infrequent)的节点,这里的c和d根据前述计算频数的方法知道满足最小support条件。至此,已经得到了关于e的Conditional FP-Tree。

    5)利用前面得到的关于e的CFPT,找到所有以de、ce、ae结尾(be不考虑因为b已经被删除)的frequent itemlist。这里直接调用分治的过程进行递归。例如对于de来说,在e的CFPT中找到关于de的前缀路径子树……得到de的CFPT。
    例如 edeade ece eae

讨论:对于单枝前缀路径子树,一次就能生成所有frequent patterns。例如:

* 此处红框选中的子树是m-cond. based,单枝树为{}-f3-c3-a3.
* 这是一个迭代的过程,节点a产生了第二棵树{}-f3-c3. 节点c产生了树{}-f3.
然后第二棵树中的节点c产生了最后一棵树{}-f3. 节点f无法再产生新的树。
* 第一棵树是m-cond. based,产生了组合fm,cm,am
* 第二棵树是am-cond. based,产生了fam,cam
* 第三棵树是cm-cond. based,产生了fcm
* 最后一棵树产生了fcam
* 所以我们可以得到并集 fm, cm, am, fam, fcm, cam, fcam。

课程习题:


这里Parallel Project比较耗费空间,因为它是根据需要计算的不同的X-cond. based进行任务分割来计算的,但是比较快;而Partition则根据树枝进行切分,这样是真正意义上的“partition”。

Mining Closed Patterns

这篇关于Efficient Pattern Mining Methods的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/651398

相关文章

解读静态资源访问static-locations和static-path-pattern

《解读静态资源访问static-locations和static-path-pattern》本文主要介绍了SpringBoot中静态资源的配置和访问方式,包括静态资源的默认前缀、默认地址、目录结构、访... 目录静态资源访问static-locations和static-path-pattern静态资源配置

[论文笔记]QLoRA: Efficient Finetuning of Quantized LLMs

引言 今天带来LoRA的量化版论文笔记——QLoRA: Efficient Finetuning of Quantized LLMs 为了简单,下文中以翻译的口吻记录,比如替换"作者"为"我们"。 我们提出了QLoRA,一种高效的微调方法,它在减少内存使用的同时,能够在单个48GB GPU上对65B参数的模型进行微调,同时保持16位微调任务的完整性能。QLoRA通过一个冻结的4位量化预

【VueJS】深入理解 computed 和 methods 方法

前言   模板内的表达式是非常便利的,但是它们实际上只用于简单的运算。在模板中放入太多的逻辑会让模板过重且难以维护。例如: <div id="example">{{ message.split('').reverse().join('') }}</div> computed 方法   所以引入了计算属性computed,将复杂的逻辑放入计算中进行处理,同时computed有缓存功能,

设计模式 -- 职责链模式(Chain of Responsibility Pattern)

1 问题引出 1.1 学校 OA 系统的采购审批项目 如果金额 小于等于 5000, 由教学主任审批 (0<=x<=5000)如果金额 小于等于 10000, 由院长审批 (5000<x<=10000)如果金额 小于等于 30000, 由副校长审批 (10000<x<=30000)如果金额 超过 30000 以上,有校长审批 ( 30000<x) 1.2 传统方式 传统方式是

Vue3,格式化时间的函数作为组件的方法(methods)、计算属性(computed properties)来使用

确实,在Vue3组件中,你可以将这些用于格式化时间的函数作为组件的方法(methods)来使用,或者更优雅地,作为计算属性(computed properties)来使用,特别是当你需要基于响应式数据动态地格式化时间时。 作为方法(Methods) 在Vue组件的methods对象中定义这些函数,并在模板或其他方法中调用它们。 <template> <div> <p>Formatted

配置aop报错: Pointcut is not well-formed: expecting 'name pattern' at character position

切入点表达式的使用规则: execution(modifiers-pattern? ret-type-pattern declaring-type-pattern? name-pattern(param-pattern) throws-pattern?) 有“?”号的部分表示可省略的,modifers-pattern表示修饰符如public、protected等,ret-type-patter

《Efficient Batch Processing for Multiple Keyword Queries on Graph Data》——论文笔记

ABSTRACT 目前的关键词查询只关注单个查询。对于查询系统来说,短时间内会接受大批量的关键词查询,往往不同查询包含相同的关键词。 因此本文研究图数据多关键词查询的批处理。为多查询和单个查询找到最优查询计划都是非常复杂的。我们首先提出两个启发式的方法使关键词的重叠最大并优先处理规模小的关键词。然后设计了一个同时考虑了数据统计信息和搜索语义的基于cardinality的成本估计模型。 1.

奇异递归模板模式(Curiously Recurring Template Pattern)

奇异递归模板模式(Curiously Recurring Template Pattern) - 知乎 (zhihu.com) 本文来自上面的文章!!!本菜鸡学习和记录一下。 CRTP是C++模板编程时的一种惯用法:把派生类作为基类的模板参数。 1.静态多态 #include <iostream>using namespace std;template <typename Child>

《The Power of Scale for Parameter-Efficient Prompt Tuning》论文学习

系列文章目录 文章目录 系列文章目录一、这篇文章主要讲了什么?二、摘要中T5是什么1、2、3、 三、1、2、3、 四、1、2、3、 五、1、2、3、 六、1、2、3、 七、1、2、3、 八、1、2、3、 一、这篇文章主要讲了什么? The article “The Power of Scale for Parameter-Efficient Prompt Tuning

pandas errors Pattern matched multiple keys

Set some Pandas options as you like old version #pd.set_option(‘max_columns’, 40) #pd.set_option(‘max_rows’, 30) new version pd.options.display.max_rows=30 pd.options.display.max_columns=40