Advertisement
gry1994tistorycom

Untitled

May 31st, 2020
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.62 KB | None | 0 0
  1. # [Q3-1] 최소한 3개 이상의 support, 3개 이상의 confidence, 총 9개 이상의 조합에 대한 규칙 생성
  2.  
  3. supportlist <- c(0.001,0.002,0.005,0.01)
  4. confidencelist <- c(0.001,0.005,0.01,0.05)
  5.  
  6. ruleMatrix <- matrix(0, length(supportlist), length(confidencelist))
  7. colnames(ruleMatrix) <- confidencelist
  8. rownames(ruleMatrix) <- supportlist
  9. ruleMatrix
  10.  
  11. for (i in 1:length(supportlist)){
  12.   for (j in 1:length(confidencelist)){
  13.   rules <- apriori(tmp_single, parameter=list(support=supportlist[i], confidence=confidencelist[j]))
  14.   # Check the generated rules
  15.   ruleMatrix[i,j] <- length(rules)
  16.   }
  17. }
  18. ruleMatrix
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement