文件名称:R中的Apriori规则
文件大小:193KB
文件格式:DOC
更新时间:2017-12-28 07:11:17
Apriori
> install.packages("arules")> hw4<-read.csv("hw4.csv") > playlist <- split(x=hw4[,"class"],f=hw4$student) > playlist <- lapply(playlist,unique) > playlist <- as(playlist,"transactions") > itemFrequencyPlot(playlist, support=.3)> myrules <- apriori(playlist,parameter=list(support=.3,confidence=.3))