gpt4 book ai didi

r - 归还空LHS的规则

转载 作者:行者123 更新时间:2023-12-04 16:58:40 25 4
gpt4 key购买 nike

我有一个数据集,看起来像这样:

"user.get","search_restaurants","cuisines.get"
"user.get","search_restaurants","user.get","search_restaurants"
"order/address/get_user_addresses"
"search_restaurants","search_restaurantssearch_restaurants"
"restaurant.get","search_restaurants","order/menu","restaurant.get","restaurant.get","restaurant.get","order/menu","order/menu","restaurant.get","restaurant.getsearch_restaurantsrestaurant.get","user.get","order/menu","order/menu","get_user_reviews_filtered","order/menu","restaurant.get"

当我在上面运行apriori算法时:
txn1 = read.transactions(file="path", rm.duplicates=TRUE)
basket_rules <- apriori(txn1, parameter = list(sup = 0.01, conf = 0.01,target="rules"))
inspect(basket_rules)

我得到空白的lhs。哪个是:
{} => {cuisines.get}

知道为什么会这样吗?一个如何解决这个问题?

最佳答案

help("apriori"):

The default value in APparameter for minlen is 1. This means that rules with only one item (i.e., an empty antecedent/LHS) like

{} => {beer}

will be created. These rules mean that no matter what other items are involved the item in the RHS will appear with the probability given by the rule's confidence (which equals the support). If you want to avoid these rules then use the argument parameter=list(minlen=2).

关于r - 归还空LHS的规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38989673/

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