gpt4 book ai didi

arules - 如何在 arules 包中添加更多感兴趣的度量

转载 作者:行者123 更新时间:2023-12-03 16:16:16 24 4
gpt4 key购买 nike

作为 arules 包中“检查”功能的结果,我想添加两个额外的措施。它们是 Kulczynski 和不平衡比。
你能帮我提供信息吗,在哪里可以找到检查函数的代码以及如何修改它。

谢谢

最佳答案

您需要做的就是向质量 data.frame 添加额外的列。检查将自动挑选那些。这是来自 ? interestMeasure 的示例:

data("Income")
rules <- apriori(Income)

## calculate a single measure and add it to the quality slot
quality(rules) <- cbind(quality(rules),
hyperConfidence = interestMeasure(rules, method = "hyperConfidence",
transactions = Income))

inspect(head(sort(rules, by = "hyperConfidence")))

lhs rhs support confidence lift hyperConfidence
1 {ethnic classification=hispanic} => {education=no college graduate} 0.1096568 0.8636884 1.224731 1
2 {dual incomes=no} => {marital status=married} 0.1400524 0.9441176 2.447871 1
3 {occupation=student} => {marital status=single} 0.1449971 0.8838652 2.160490 1
4 {occupation=student} => {age=14-34} 0.1592496 0.9707447 1.658345 1
5 {occupation=student} => {dual incomes=not married} 0.1535777 0.9361702 1.564683 1
6 {occupation=student} => {income=$0-$40,000} 0.1381617 0.8421986 1.353027 1

关于arules - 如何在 arules 包中添加更多感兴趣的度量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32518961/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com