首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Arules包--Trio错误

Arules包--Trio错误
EN

Stack Overflow用户
提问于 2012-12-07 00:32:10
回答 1查看 1.6K关注 0票数 0

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

代码语言:javascript
复制
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**

可重现的例子:

代码语言:javascript
复制
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))
EN

回答 1

Stack Overflow用户

发布于 2014-07-09 22:08:02

问题是arules包中的错误处理中存在一个bug。内存耗尽,当先验代码试图创建适当的错误消息时,它会创建一个对printf的无效调用,该调用在Windows下由trio库处理。所以简而言之,你应该会得到一个内存不足的错误。

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

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

-Michael

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13748149

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档