4. Apriori 알고리즘 결과 필터링하기
# 결과 중 처음 5개만 출력 >>> inspect(rules[1:5]) lhs rhs support confidence lift count [1] {liquor,red/blush wine} => {bottled beer} 0.001931876 0.9047619 11.235269 19 [2] {curd,cereals} => {whole milk} 0.001016777 0.9090909 3.557863 10 [3] {yogurt,cereals} => {whole milk} 0.001728521 0.8095238 3.168192 17 [4] {butter,jam} => {whole milk} 0.001016777 0.8333333 3.261374 10 [5] {soups,bottled beer} => {whole milk} 0.001118454 0.9166667 3.587512 11 # 신뢰도 기준으로 내림차순의 패턴들을 rules에 할당 >>> rules<-sort(rules, by = "confidence", decreasing = TRUE) >>> inspect(rules[1:5]) lhs rhs support confidence lift count [1] {rice,sugar} => {whole milk} 0.001220132 13.913649 12 [2] {canned fish,hygiene articles} => {whole milk} 0.001118454 13.913649 11 [3] {root vegetables,butter,rice} => {whole milk} 0.001016777 13.913649 10 [4] {root vegetables,whipped/sour cream,flour} => {whole milk} 0.001728521 13.913649 17 [5] {butter,soft cheese,domestic eggs} => {whole milk} 0.001016777 13.913649 10