我有两个数据集,包括训练和测试。对于训练数据集,我提取了许多关联规则,如下所示。现在我想将这些规则用于测试交易数据集。我需要找到符合这些规则的交易 ID。帮我!
library("arules");
candidates<-read.transactions(file="D:\\Ranker\\Candidates.csv",rm.duplicates=TRUE, format="single",sep=",",col=c(1,2));
candidates.test<-read.transactions(file="D:\\Ranker\\Candidates_test.csv",rm.duplicates=TRUE, format="single",sep=",",col=c(1,2));
rules <- apriori(candidates, parameter = list(supp=0.0000001, conf=1, target="rules"),appearance = list(rhs=c("no"),default="lhs"))