【问题标题】:Running apriori in R does not result in any rules.在 R 中运行 apriori 不会产生任何规则。
【发布时间】:2016-06-15 15:59:05
【问题描述】:

我试图在我的数据集上运行 apriori 但没有得到任何规则。 这是我所看到的。

> rules <- apriori(mydata, parameter = list(supp=.01))
Apriori

Parameter specification:
 confidence minval smax arem  aval originalSupport support minlen maxlen target   ext
        0.8    0.1    1 none FALSE            TRUE    0.01      1     10  rules FALSE

Algorithmic control:
 filter tree heap memopt load sort verbose
    0.1 TRUE TRUE  FALSE TRUE    2    TRUE

Absolute minimum support count: 700 

set item appearances ...[0 item(s)] done [0.00s].
set transactions ...[1335 item(s), 70000 transaction(s)] done [0.01s].
sorting and recoding items ... [11 item(s)] done [0.00s].
creating transaction tree ... done [0.00s].
checking subsets of size 1 done [0.00s].
writing ... [0 rule(s)] done [0.00s].
creating S4 object  ... done [0.00s].
> inspect(rules)

提前谢谢你。

【问题讨论】:

  • 也许您的数据集根本不包含任何关联规则。
  • 来自?apriori: “默认行为是挖掘规则,支持0.1,置信度0.8,maxlen 10。” - 调整置信度值?您可以提供数据集以停止猜测工作。

标签: r apriori market-basket-analysis


【解决方案1】:

你没有规则的原因是因为数据而不是代码。我的意思是您要求的参数(支持 = 0.1)和您留下的默认参数(置信度 = 0.8)对于您拥有的数据来说太高了。

这可能是因为您的数据过于异构。解决方案是减少参数。可能它会与类似的东西一起使用:

rules <- apriori(mydata,parameter(list=(support=0.001,confidence=0.3)

希望对您有所帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-24
    • 1970-01-01
    • 1970-01-01
    • 2017-03-18
    • 2018-06-04
    • 1970-01-01
    相关资源
    最近更新 更多