gry1994tistorycom

Untitled

May 31st, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.48 KB | None | 0 0
  1. # List the first three rules with the highest lift values
  2. lhss <- inspect(rules)$lhs
  3. rhss <- inspect(rules)$rhs
  4. effi <- inspect(rules)$support * inspect(rules)$confidence * inspect(rules)$lift # 효용성 (순위)
  5.  
  6. rulesMatrix <- matrix(0, length(lhss), 3)
  7. colnames(rulesMatrix) <- c("lhs","rhs","effi")
  8. rulesMatrix[,1] <- lhss
  9. rulesMatrix[,2] <- rhss
  10. rulesMatrix[,3] <- effi
  11. # effi(효용성) 기준으로 정렬
  12. rulesMatrix <- rulesMatrix[order(rulesMatrix[,3]), ]
  13. rulesMatrix
Add Comment
Please, Sign In to add comment