Arules包 - 三重奏错误

时间:2012-12-06 16:32:10

标签: r arules

我正在使用大型二进制数据矩阵4547 x 5415进行关联规则挖掘。通常,每一行都是一个事务,每列都是一个项目。每当我调用arules包时,它会产生一些引用trio库的神秘错误消息。有没有人有这种错误的经验?

i[1:10,1:10]
     101402 101403 101404 101405 101406 101411 101412 101413 101414 101415
 [1,]      0      0      0      1      0      0      1      0      0      0
 [2,]      0      1      0      0      0      0      1      0      0      0
 [3,]      0      0      0      0      0      0      1      0      0      0
 [4,]      0      0      0      1      0      0      0      0      0      1
 [5,]      0      0      0      1      0      0      0      0      0      1
 [6,]      0      1      0      0      0      1      0      0      0      0
 [7,]      0      0      0      0      0      0      1      0      0      0
 [8,]      0      0      1      0      0      0      0      0      0      1
 [9,]      0      0      0      0      0      1      0      0      0      0
[10,]      0      0      0      0      1      0      1      0      0      0



rules <- apriori(i, parameter=list(support=0.001, confidence=0.5))

    parameter specification:
     confidence minval smax arem  aval originalSupport support minlen maxlen target
            0.5    0.1    1 none FALSE            TRUE   0.001      1     10  rules
       ext
     FALSE

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

    apriori - find association rules with the apriori algorithm
    version 4.21 (2004.05.09)        (c) 1996-2004   Christian Borgelt
    set item appearances ...[0 item(s)] done [0.00s].
    set transactions ...[5415 item(s), 4547 transaction(s)] done [0.47s].
    sorting and recoding items ... [4908 item(s)] done [0.18s].
    creating transaction tree ... done [0.01s].
    **checking subsets of size 1 2Error in apriori(i, parameter = list(support = 0.001, confidence = 0.5)) : 
      internal error in trio library**

可重复的例子:

y <- matrix(nrow=4547, ncol=5415)
y <- apply(y, c(1,2), function(x) sample(c(0,1),1))
rules <- apriori(y, parameter=list(support=0.001, confidence=0.5))

1 个答案:

答案 0 :(得分:4)

问题是arules包中的错误处理存在错误。内存不足,当apriori代码尝试创建相应的错误消息时,它会创建一个无效的printf调用,该调用由Windows在三人库下处理。所以简而言之,你应该得到一个内存不足的错误。

此问题将在arules版本1.1-4中解决。

为避免内存不足,您需要增加支持和/或限制项目集中的项目数(参数列表中的maxlen)

-Michael