【问题标题】:Apriori in WEKAWEKA 中的先验
【发布时间】:2017-04-06 18:21:47
【问题描述】:

我对所有这些数据挖掘、WEKA 工具等都是新手,

在我的学术项目中,我必须处理错误报告。我的 SQL Server 中有它们。我采用了错误摘要属性并应用了标记化、停用词删除和词干提取技术。

摘要中的所有词干都存储在数据库中;分开。现在我必须应用频繁模式挖掘算法,并使用WEKA工具找出频繁项集。我有这样的 arff 文件。

@relation ItemSets

@attribute bugid integer
@attribute summary string

@data
755113,enhanc;keep;log;recommend;share
759414,access;review;social
763806,allow;intrus;less;provid;shrunken;sidebar;social;specifi
767221,datacloneerror;deeper;dig;framework;jsm
771353,document;integr;provid;secur;social
785540,avail;determin;featur;method;provid;social;whether
785591,chat;dock;horizont;nest;overlap;scrollbar
787767,abus;api;implement;perform;runtim;warn;worker

在 Weka 中打开它后,在 WEKA Explorer 的 Associate 选项卡下,我无法在选择 Apriori 的情况下启动进程(开始按钮已禁用)。

现在请建议我如何使用 WEKA 在摘要属性上查找频繁项集。我需要认真的帮助。帮助将不胜感激。提前致谢!

【问题讨论】:

    标签: weka text-mining apriori


    【解决方案1】:

    Apriori 无法在 Weka 中使用您的文件的原因是 Apriori 仅允许名义属性值。你想找到什么样的规则?你能举一个你想获得的规则的例子吗?

    values_you_want_to_be_the_antecedent_part_of_your_rule ==> values_you_want_to_be_the_consequent_part_of_your_rule
    

    像这样将你的属性更改为名义上的

    @relation ItemSets
    
    @attribute bugid {755113, 759414, 763806}
    @attribute summary {'enhanc;keep;log;recommend;share', 'access;review;social', 'allow;intrus;less;provid;shrunken;sidebar;social;specifi'}
    
    @data
    755113,'enhanc;keep;log;recommend;share'
    759414,'access;review;social'
    763806,'allow;intrus;less;provid;shrunken;sidebar;social;specifi'
    

    只会给你这样的规则

    bugid=755113 1 ==> summary=enhanc;keep;log;recommend;share 1    <conf:(1)> lift:(3) lev:(0.22)
    

    如果您在摘要词中寻找频繁项集,则 bugid 无关紧要,您可以将其从文件中删除。 Apriori 用于获取关联规则,例如enhanc, keeplog 提供支持 X 和置信度 Y。要查找频繁项集,您需要重组数据,以便每个摘要词都是具有值 true/false 或 true/missing 的属性,请参阅this 问题。

    在 Weka 中尝试以下文件。选择 Associate,选择 Apriori,双击选择按钮旁边的白色输入字段。在那里,将 outputItemSets 设置为 true。在控制台输出中,您将看到所有频繁项集和所有获得的具有足够支持的规则。

    @relation ItemSets
    
    @attribute enhanc {true}
    @attribute keep {true}
    @attribute log {true}
    @attribute recommend {true}
    @attribute share {true}
    @attribute access {true}
    @attribute review {true}
    @attribute social {true}
    @attribute allow {true}
    @attribute intrus {true}
    @attribute less {true}
    @attribute provid {true}
    @attribute shrunken {true}
    @attribute sidebar {true}
    @attribute specifi {true}
    
    
    @data
    true,true,true,true,true,?,?,?,?,?,?,?,?,?,?
    ?,?,?,?,?,true,true,true,?,?,?,?,?,?,?
    ?,?,?,?,?,?,?,true,true,true,true,true,true,true,true
    

    问号? 表示缺失值。

    【讨论】:

    • 我只想要给定支持计数和置信度的频繁项集。此外,我不能选择名义属性,因为我的 bugid 是自动递增的,并且摘要不能来自特定的一组属性。它可以是由任意数量的单词组成的任意字符串。
    • 您能否举一个您想要获得的规则示例,如我编辑的答案中所示?
    • enhanc,browser,js like that I want 2 item set three item set etc.
    • 但我们不能指望摘要中的文字。用户可以给出任何类型的词。所以形成这些属性是困难的。 Apriori 不是强制性的。频繁模式挖掘中的任何算法。就像 FP 增长一样。
    • 你想要达到什么目的?请描述场景。除非您提供更多信息,否则我无法帮助您。
    猜你喜欢
    • 2013-01-09
    • 1970-01-01
    • 2023-03-10
    • 2013-08-16
    • 2019-07-27
    • 2013-10-10
    • 2016-08-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多