简体   繁体   English

R关联规则apriori - 抑制项目的分组

[英]R association rules apriori — suppress grouping of items

I'm using the apriori function from the arules package to perform analyses for item association. 我正在使用arules包中的apriori函数来执行项目关联的分析。 After coercing the results into a datframe, I notice the output can be grouped like so in some instances: 在将结果强制转换为数据帧之后,我注意到输出可以在某些情况下进行分组:

 LHS                 RHS        Support        Confidence      Lift        Count
{Item1, Item2}      {Item3}      .84             0.99          12.3          6

Is there a way for force the function to perform the analysis just between two items in each transaction and yield the corresponding support, confidence, etc? 有没有办法强制函数在每个事务中的两个项目之间执行分析并产生相应的支持,信心等? In other words, can I force apriori to split the above result into something like: 换句话说,我可以强制apriori将上述结果分成如下:

 LHS           RHS        Support        Confidence      Lift       Count
{Item1}      {Item3}        a                b            c           d
{Item2}      {Item3}        e                f            g           h

maxlen in apriori does not act as a filter after mining. apriori中的maxlen在采矿后不起过滤器的作用。 apriori creates frequent itemsets starting with length 1 then 2, 3, ... and maxlen stops the mining process. apriori创建频繁的项目集,从长度1开始,然后是2,3,......并且maxlen停止挖掘过程。

minlen on the other hand is a filter because all shorter frequent itemsets have to be found first. 另一方面, minlen是一个过滤器,因为必须首先找到所有较短的频繁项目集。

If you are asking if you can determine support and confidence of 如果你问你是否可以确定支持和信心

{Item1} -> {Item3}
{Item2} -> {Item3}

by just using the support and confidence of 只需使用支持和信心

{Item1, Item2} -> {Item3}

then the answer is no. 然后答案是否定的。 However, from the apriori property we know at least the following: 但是,从apriori属性我们至少知道以下内容:

supp({Item1} -> {Item3}) >= supp({Item1, Item2} -> {Item3})
supp({Item2} -> {Item3}) >= supp({Item1, Item2} -> {Item3})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM