#Introduction
Association rule mining is a tool used to find patterns in data of variables occuring together that are called rules. To determine what rules are the most valuable to a business, measurements like support, confidence, and lift are taken. Measures of support are taken to filter out uninteresting or common knowledge rules of the business. The confidence of a rule is how certain a rule is likely to happen but uninteresting and common knowledge rules are removed from the final results. Lastly, the lift is the most important measurement, creating levels of “interesting-ness” by determining if variables have influence on one another or if it was expected for these two variables to occur together.
#Load the libraries to begin the analysis
library(plyr)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:plyr':
##
## arrange, count, desc, failwith, id, mutate, rename, summarise,
## summarize
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
##install.packages("arules")
library(arules)
## Loading required package: Matrix
##
## Attaching package: 'arules'
## The following object is masked from 'package:dplyr':
##
## recode
## The following objects are masked from 'package:base':
##
## abbreviate, write
library(arulesViz)
## Loading required package: grid
## Registered S3 method overwritten by 'seriation':
## method from
## reorder.hclust gclus
library(plotly)
## Loading required package: ggplot2
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following objects are masked from 'package:plyr':
##
## arrange, mutate, rename, summarise
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(tidyverse)
## -- Attaching packages -------------------------------------------------------------------------- tidyverse 1.2.1 --
## v tibble 2.1.3 v purrr 0.3.2
## v tidyr 0.8.3 v stringr 1.4.0
## v readr 1.3.1 v forcats 0.4.0
## -- Conflicts ----------------------------------------------------------------------------- tidyverse_conflicts() --
## x plotly::arrange() masks dplyr::arrange(), plyr::arrange()
## x purrr::compact() masks plyr::compact()
## x dplyr::count() masks plyr::count()
## x tidyr::expand() masks Matrix::expand()
## x dplyr::failwith() masks plyr::failwith()
## x plotly::filter() masks dplyr::filter(), stats::filter()
## x dplyr::id() masks plyr::id()
## x dplyr::lag() masks stats::lag()
## x plotly::mutate() masks dplyr::mutate(), plyr::mutate()
## x arules::recode() masks dplyr::recode()
## x plotly::rename() masks dplyr::rename(), plyr::rename()
## x plotly::summarise() masks dplyr::summarise(), plyr::summarise()
## x dplyr::summarize() masks plyr::summarize()
#Read in the data to be pre processed, set rounding to 2 decimal places
bd<- read.csv("C:/Users/katie/Desktop/bankdata_csv_all.csv")
options(digits = 2)
About the Data
The bank data was originally stored in a CSV file that was read into RStudio and to be pre-processed before creating rules. First, the ID field was removed from the column as it did not constitute as an attribute that would be useful for rules. Then, the numeric fields like ‘age’ and ‘income’ had to be discretized so that it could be used in the apriori algorithm. Age was put into seven age ranges of child (0-9), teens(10-19), twenties(20-29),thirties(30-39), fourties(40-49), fifties(50-59), and old(60+). Next, the data for the income was put into three separate ranges by taking the maximum income and subtracting the minimum income and dividing into three categories: $5,010-$24,400, $24,401-$43,800, and $43,801-$61,300.
#Preprocess the data
anyNA(bd)
## [1] FALSE
bd <- bd[,-1]
bd$age<- discretizeDF(bd$age)
bd$age <- cut(bd$age, breaks = c(0,10,20,30,40,50,60,Inf),labels=c("child","teens","twenties","thirties","fourties","fifties","old"))
min_income <- min(bd$income)
max_income <- max(bd$income)
bins = 3
width=(max_income - min_income)/bins;
bd$income = cut(bd$income, breaks=seq(min_income, max_income, width))
After discretizing the data, the column containing the number of children a person had was transformed into a nominal category. Also, the fields that contained “YES” or “NO” were transformed to “variable name = variable name = YES/NO” so that it would be clear in the rules what attribute is related to the YES or NO. Subsequently those and the remaining fields were put into factors as well so the apriori algorithm could work properly.
#discretize the data
bd$children=factor(bd$children)
bd$married=dplyr::recode(bd$married, YES="married=YES", NO="married=NO")
bd$car=dplyr::recode(bd$car, YES="car=YES", NO="car=NO")
bd$save_act=dplyr::recode(bd$save_act, YES="save_act=YES", NO="save_act=NO")
bd$current_act=dplyr::recode(bd$current_act, YES="current_act=YES", NO="current_act=NO")
bd$mortgage=dplyr::recode(bd$mortgage, YES="mortgage=YES", NO="mortgage=NO")
bd$pep=dplyr::recode(bd$pep, YES="pep=YES", NO="pep=NO")
str(bd)
## 'data.frame': 600 obs. of 11 variables:
## $ age : Factor w/ 7 levels "child","teens",..: 5 4 6 3 6 6 3 6 4 6 ...
## $ sex : Factor w/ 2 levels "FEMALE","MALE": 1 2 1 1 1 1 2 2 1 2 ...
## $ region : Factor w/ 4 levels "INNER_CITY","RURAL",..: 1 4 1 4 2 4 2 4 3 4 ...
## $ income : Factor w/ 3 levels "(5.01e+03,2.44e+04]",..: 1 2 1 1 3 2 1 2 2 1 ...
## $ married : Factor w/ 2 levels "married=NO","married=YES": 1 2 2 2 2 2 1 2 2 2 ...
## $ children : Factor w/ 4 levels "0","1","2","3": 2 4 1 4 1 3 1 1 3 3 ...
## $ car : Factor w/ 2 levels "car=NO","car=YES": 1 2 2 1 1 1 1 2 2 2 ...
## $ save_act : Factor w/ 2 levels "save_act=NO",..: 1 1 2 1 2 2 1 2 1 2 ...
## $ current_act: Factor w/ 2 levels "current_act=NO",..: 1 2 2 2 1 2 2 2 1 2 ...
## $ mortgage : Factor w/ 2 levels "mortgage=NO",..: 1 2 1 1 1 1 1 1 1 1 ...
## $ pep : Factor w/ 2 levels "pep=NO","pep=YES": 2 1 1 1 1 2 2 1 1 1 ...
When creating the rules for this analysis, it was important to gather rules that would be useful for the business about their clients and what makes them have or not have a Personal Equity Plan (PEP). Initially, a general overview of the entire dataset was used to create rules to see if any PEP measure was present in the top 30 rules of the data set. These rules were created by the following parameters: support at 0.01, confidence set to 90%, and four as maximum number of items allowed in a rule. Then, a visual graph was produced to **see what items were part ofthe biggest rulesets and get an over view [ RE DO THIS]
##Creating the rules(general)
rules<- apriori(bd, parameter = list(supp=0.01, conf=0.9, maxlen = 4))
## Apriori
##
## Parameter specification:
## confidence minval smax arem aval originalSupport maxtime support minlen
## 0.9 0.1 1 none FALSE TRUE 5 0.01 1
## maxlen target ext
## 4 rules FALSE
##
## Algorithmic control:
## filter tree heap memopt load sort verbose
## 0.1 TRUE TRUE FALSE TRUE 2 TRUE
##
## Absolute minimum support count: 6
##
## set item appearances ...[0 item(s)] done [0.00s].
## set transactions ...[31 item(s), 600 transaction(s)] done [0.00s].
## sorting and recoding items ... [31 item(s)] done [0.00s].
## creating transaction tree ... done [0.00s].
## checking subsets of size 1 2 3 4
## Warning in apriori(bd, parameter = list(supp = 0.01, conf = 0.9, maxlen
## = 4)): Mining stopped (maxlen reached). Only patterns up to a length of 4
## returned!
## done [0.00s].
## writing ... [1074 rule(s)] done [0.00s].
## creating S4 object ... done [0.00s].
rules<- sort(rules, decreasing = FALSE, by ="lift")
plot(rules, measure = c("support", "lift"), shading = "confidence", main = "Support, Lift, and Confidence Top Rules")
## To reduce overplotting, jitter is added! Use jitter = 0 to prevent jitter.
generalRules30<- head(rules, n = 30, by = "lift")
inspect(generalRules30)
## lhs rhs support confidence lift count
## [1] {region=RURAL,
## children=3,
## pep=pep=YES} => {income=(4.38e+04,6.31e+04]} 0.013 1.00 7.5 8
## [2] {age=old,
## children=2,
## mortgage=mortgage=YES} => {income=(4.38e+04,6.31e+04]} 0.010 1.00 7.5 6
## [3] {sex=MALE,
## region=TOWN,
## income=(4.38e+04,6.31e+04]} => {age=old} 0.012 1.00 6.7 7
## [4] {income=(4.38e+04,6.31e+04],
## children=3} => {region=RURAL} 0.013 1.00 6.2 8
## [5] {income=(4.38e+04,6.31e+04],
## children=3,
## pep=pep=YES} => {region=RURAL} 0.013 1.00 6.2 8
## [6] {income=(4.38e+04,6.31e+04],
## children=3,
## mortgage=mortgage=NO} => {region=RURAL} 0.013 1.00 6.2 8
## [7] {income=(4.38e+04,6.31e+04],
## children=3,
## save_act=save_act=YES} => {region=RURAL} 0.013 1.00 6.2 8
## [8] {sex=FEMALE,
## income=(4.38e+04,6.31e+04],
## children=2} => {age=old} 0.015 0.90 6.0 9
## [9] {region=SUBURBAN,
## children=0,
## current_act=current_act=NO} => {mortgage=mortgage=YES} 0.010 1.00 2.9 6
## [10] {age=fourties,
## region=SUBURBAN,
## married=married=NO} => {income=(2.44e+04,4.38e+04]} 0.010 1.00 2.6 6
## [11] {age=fourties,
## region=RURAL,
## car=car=NO} => {income=(2.44e+04,4.38e+04]} 0.013 1.00 2.6 8
## [12] {age=fifties,
## children=2,
## save_act=save_act=NO} => {income=(2.44e+04,4.38e+04]} 0.010 1.00 2.6 6
## [13] {age=fifties,
## car=car=YES,
## save_act=save_act=NO} => {income=(2.44e+04,4.38e+04]} 0.020 1.00 2.6 12
## [14] {age=fifties,
## married=married=NO,
## save_act=save_act=NO} => {income=(2.44e+04,4.38e+04]} 0.018 0.92 2.3 11
## [15] {age=fifties,
## children=3,
## pep=pep=NO} => {income=(2.44e+04,4.38e+04]} 0.015 0.90 2.3 9
## [16] {age=teens,
## mortgage=mortgage=YES,
## pep=pep=YES} => {children=0} 0.010 1.00 2.3 6
## [17] {region=SUBURBAN,
## save_act=save_act=NO,
## mortgage=mortgage=YES} => {children=0} 0.013 1.00 2.3 8
## [18] {age=fifties,
## income=(4.38e+04,6.31e+04],
## pep=pep=NO} => {children=0} 0.020 1.00 2.3 12
## [19] {sex=MALE,
## income=(4.38e+04,6.31e+04],
## pep=pep=NO} => {children=0} 0.018 1.00 2.3 11
## [20] {income=(4.38e+04,6.31e+04],
## car=car=NO,
## pep=pep=NO} => {children=0} 0.022 1.00 2.3 13
## [21] {income=(4.38e+04,6.31e+04],
## mortgage=mortgage=NO,
## pep=pep=NO} => {children=0} 0.025 1.00 2.3 15
## [22] {income=(4.38e+04,6.31e+04],
## married=married=YES,
## pep=pep=NO} => {children=0} 0.037 1.00 2.3 22
## [23] {age=fourties,
## save_act=save_act=NO,
## mortgage=mortgage=YES} => {children=0} 0.015 1.00 2.3 9
## [24] {age=old,
## married=married=NO,
## children=1} => {region=INNER_CITY} 0.010 1.00 2.2 6
## [25] {income=(4.38e+04,6.31e+04],
## pep=pep=NO} => {children=0} 0.042 0.96 2.2 25
## [26] {income=(4.38e+04,6.31e+04],
## save_act=save_act=YES,
## pep=pep=NO} => {children=0} 0.042 0.96 2.2 25
## [27] {income=(4.38e+04,6.31e+04],
## children=3} => {pep=pep=YES} 0.013 1.00 2.2 8
## [28] {income=(4.38e+04,6.31e+04],
## children=1} => {pep=pep=YES} 0.027 1.00 2.2 16
## [29] {age=fourties,
## children=1} => {pep=pep=YES} 0.053 1.00 2.2 32
## [30] {age=old,
## region=SUBURBAN,
## income=(4.38e+04,6.31e+04]} => {pep=pep=YES} 0.012 1.00 2.2 7
plot(generalRules30, method = "graph")
After gathering general rules about the dataset, the right hand side (RHS) was set to either “pep=pep=YES” or “pep=pep=NO” to examine what kind of clients were or were not buying the Personal Equity Plan. The first set of rules were based on clients that had the PEP and the parameters were set to support at 0.001 and confidence at 90%. Furthermore, the rules were limited to a maximum of four items per itemset to reduce redundancy with too many items per rule.
##RHS = PEP = PEP = YES
yesrules<- apriori(bd, parameter = list(supp=0.01, conf = 0.85, maxlen = 4), appearance =list(default = "lhs", rhs="pep=pep=YES"),control=list(verbose=F))
yesrules<- sort(yesrules, decreasing = FALSE , by ="confidence")
inspect(yesrules[1:20])
## lhs rhs support confidence lift count
## [1] {income=(4.38e+04,6.31e+04],
## married=married=NO} => {pep=pep=YES} 0.038 0.85 1.9 23
## [2] {income=(4.38e+04,6.31e+04],
## married=married=NO,
## save_act=save_act=YES} => {pep=pep=YES} 0.038 0.85 1.9 23
## [3] {age=old,
## income=(4.38e+04,6.31e+04],
## mortgage=mortgage=NO} => {pep=pep=YES} 0.048 0.85 1.9 29
## [4] {region=TOWN,
## children=1} => {pep=pep=YES} 0.058 0.85 1.9 35
## [5] {age=thirties,
## children=1} => {pep=pep=YES} 0.040 0.86 1.9 24
## [6] {age=teens,
## children=0,
## mortgage=mortgage=YES} => {pep=pep=YES} 0.010 0.86 1.9 6
## [7] {region=RURAL,
## income=(4.38e+04,6.31e+04],
## married=married=NO} => {pep=pep=YES} 0.010 0.86 1.9 6
## [8] {income=(4.38e+04,6.31e+04],
## married=married=NO,
## car=car=NO} => {pep=pep=YES} 0.020 0.86 1.9 12
## [9] {age=thirties,
## region=RURAL,
## save_act=save_act=NO} => {pep=pep=YES} 0.010 0.86 1.9 6
## [10] {age=thirties,
## region=RURAL,
## married=married=NO} => {pep=pep=YES} 0.010 0.86 1.9 6
## [11] {region=RURAL,
## children=1,
## car=car=NO} => {pep=pep=YES} 0.010 0.86 1.9 6
## [12] {age=fifties,
## save_act=save_act=NO,
## mortgage=mortgage=YES} => {pep=pep=YES} 0.010 0.86 1.9 6
## [13] {children=1,
## car=car=YES,
## save_act=save_act=YES} => {pep=pep=YES} 0.070 0.86 1.9 42
## [14] {married=married=YES,
## children=1,
## current_act=current_act=YES} => {pep=pep=YES} 0.093 0.86 1.9 56
## [15] {children=1,
## save_act=save_act=YES,
## current_act=current_act=YES} => {pep=pep=YES} 0.105 0.86 1.9 63
## [16] {income=(2.44e+04,4.38e+04],
## children=1,
## mortgage=mortgage=YES} => {pep=pep=YES} 0.032 0.86 1.9 19
## [17] {region=RURAL,
## children=1,
## current_act=current_act=YES} => {pep=pep=YES} 0.022 0.87 1.9 13
## [18] {age=fifties,
## income=(2.44e+04,4.38e+04],
## children=1} => {pep=pep=YES} 0.022 0.87 1.9 13
## [19] {age=fifties,
## children=1,
## current_act=current_act=YES} => {pep=pep=YES} 0.022 0.87 1.9 13
## [20] {age=thirties,
## children=1,
## mortgage=mortgage=YES} => {pep=pep=YES} 0.022 0.87 1.9 13
##visualize
options(digits = 2)
plotly_arules(yesrules, measure = c("support", "lift"), shading = "confidence", jitter = 0
,marker = list(opacity = .7, size = 10, symbol = 1), colors = c("orange", "blue"))
## Warning: 'plotly_arules' is deprecated.
## Use 'plot' instead.
## See help("Deprecated")
##pep = pep = NO
norules<- apriori(bd, parameter = list(supp=0.01, conf = 0.9, maxlen = 4), appearance =list(default = "lhs", rhs="pep=pep=NO"),control=list(verbose=F))
norules<- sort(norules, decreasing = FALSE, by ="confidence")
inspect(norules[1:20])
## lhs rhs support confidence lift count
## [1] {income=(5.01e+03,2.44e+04],
## children=3} => {pep=pep=NO} 0.045 0.90 1.7 27
## [2] {age=teens,
## children=2,
## current_act=current_act=YES} => {pep=pep=NO} 0.015 0.90 1.7 9
## [3] {age=teens,
## region=INNER_CITY,
## save_act=save_act=YES} => {pep=pep=NO} 0.015 0.90 1.7 9
## [4] {age=twenties,
## sex=FEMALE,
## children=3} => {pep=pep=NO} 0.015 0.90 1.7 9
## [5] {age=thirties,
## children=3,
## car=car=YES} => {pep=pep=NO} 0.015 0.90 1.7 9
## [6] {sex=FEMALE,
## children=3,
## current_act=current_act=NO} => {pep=pep=NO} 0.015 0.90 1.7 9
## [7] {married=married=YES,
## children=3,
## current_act=current_act=NO} => {pep=pep=NO} 0.015 0.90 1.7 9
## [8] {income=(2.44e+04,4.38e+04],
## children=3,
## save_act=save_act=YES} => {pep=pep=NO} 0.030 0.90 1.7 18
## [9] {region=INNER_CITY,
## children=3,
## car=car=NO} => {pep=pep=NO} 0.015 0.90 1.7 9
## [10] {age=twenties,
## children=2,
## current_act=current_act=YES} => {pep=pep=NO} 0.030 0.90 1.7 18
## [11] {income=(2.44e+04,4.38e+04],
## children=3,
## current_act=current_act=YES} => {pep=pep=NO} 0.032 0.90 1.7 19
## [12] {sex=MALE,
## income=(5.01e+03,2.44e+04],
## children=2} => {pep=pep=NO} 0.048 0.91 1.7 29
## [13] {age=teens,
## sex=FEMALE,
## save_act=save_act=YES} => {pep=pep=NO} 0.017 0.91 1.7 10
## [14] {age=twenties,
## children=3,
## car=car=NO} => {pep=pep=NO} 0.017 0.91 1.7 10
## [15] {age=twenties,
## children=3,
## mortgage=mortgage=NO} => {pep=pep=NO} 0.017 0.91 1.7 10
## [16] {sex=FEMALE,
## region=TOWN,
## children=3} => {pep=pep=NO} 0.017 0.91 1.7 10
## [17] {region=TOWN,
## children=3,
## car=car=NO} => {pep=pep=NO} 0.017 0.91 1.7 10
## [18] {region=TOWN,
## children=3,
## save_act=save_act=YES} => {pep=pep=NO} 0.017 0.91 1.7 10
## [19] {children=3,
## car=car=YES,
## mortgage=mortgage=YES} => {pep=pep=NO} 0.017 0.91 1.7 10
## [20] {sex=MALE,
## children=3,
## mortgage=mortgage=YES} => {pep=pep=NO} 0.017 0.91 1.7 10
norules2<- apriori(bd, parameter = list(supp=0.01, conf = 0.8, maxlen = 3), appearance =list(default = "lhs", rhs="pep=pep=NO"),control=list(verbose=F))
norules2<-sort(norules2, decreasing = FALSE, by = "confidence")
inspect(norules2[1:20])
## lhs rhs support confidence lift count
## [1] {age=teens,
## car=car=YES} => {pep=pep=NO} 0.020 0.80 1.5 12
## [2] {married=married=NO,
## children=3} => {pep=pep=NO} 0.033 0.80 1.5 20
## [3] {children=3,
## current_act=current_act=YES} => {pep=pep=NO} 0.068 0.80 1.5 41
## [4] {children=3} => {pep=pep=NO} 0.092 0.81 1.5 55
## [5] {married=married=YES,
## children=3} => {pep=pep=NO} 0.058 0.81 1.5 35
## [6] {age=twenties,
## children=2} => {pep=pep=NO} 0.037 0.81 1.5 22
## [7] {children=3,
## current_act=current_act=NO} => {pep=pep=NO} 0.023 0.82 1.5 14
## [8] {children=3,
## car=car=YES} => {pep=pep=NO} 0.047 0.82 1.5 28
## [9] {sex=MALE,
## children=3} => {pep=pep=NO} 0.042 0.83 1.5 25
## [10] {age=thirties,
## children=3} => {pep=pep=NO} 0.018 0.85 1.6 11
## [11] {age=teens,
## save_act=save_act=YES} => {pep=pep=NO} 0.030 0.86 1.6 18
## [12] {age=teens,
## sex=FEMALE} => {pep=pep=NO} 0.023 0.88 1.6 14
## [13] {age=teens,
## region=TOWN} => {pep=pep=NO} 0.013 0.89 1.6 8
## [14] {income=(5.01e+03,2.44e+04],
## children=2} => {pep=pep=NO} 0.095 0.89 1.6 57
## [15] {income=(5.01e+03,2.44e+04],
## children=3} => {pep=pep=NO} 0.045 0.90 1.7 27
## [16] {age=teens,
## children=2} => {pep=pep=NO} 0.018 0.92 1.7 11
## [17] {region=INNER_CITY,
## children=3} => {pep=pep=NO} 0.038 0.92 1.7 23
## [18] {age=twenties,
## children=3} => {pep=pep=NO} 0.023 0.93 1.7 14
## [19] {income=(2.44e+04,4.38e+04],
## children=3} => {pep=pep=NO} 0.047 0.93 1.7 28
## [20] {region=TOWN,
## children=3} => {pep=pep=NO} 0.032 0.95 1.7 19
norules3<- apriori(bd, parameter = list(supp=0.01, conf = 0.9, maxlen = 5), appearance =list(default = "lhs", rhs="pep=pep=NO"),control=list(verbose=F))
norules3<-sort(norules3, decreasing = FALSE , by = "confidence")
inspect(norules3[1:20])
## lhs rhs support confidence lift count
## [1] {income=(5.01e+03,2.44e+04],
## children=3} => {pep=pep=NO} 0.045 0.9 1.7 27
## [2] {age=teens,
## children=2,
## current_act=current_act=YES} => {pep=pep=NO} 0.015 0.9 1.7 9
## [3] {age=teens,
## region=INNER_CITY,
## save_act=save_act=YES} => {pep=pep=NO} 0.015 0.9 1.7 9
## [4] {age=twenties,
## sex=FEMALE,
## children=3} => {pep=pep=NO} 0.015 0.9 1.7 9
## [5] {age=thirties,
## children=3,
## car=car=YES} => {pep=pep=NO} 0.015 0.9 1.7 9
## [6] {sex=FEMALE,
## children=3,
## current_act=current_act=NO} => {pep=pep=NO} 0.015 0.9 1.7 9
## [7] {married=married=YES,
## children=3,
## current_act=current_act=NO} => {pep=pep=NO} 0.015 0.9 1.7 9
## [8] {income=(2.44e+04,4.38e+04],
## children=3,
## save_act=save_act=YES} => {pep=pep=NO} 0.030 0.9 1.7 18
## [9] {region=INNER_CITY,
## children=3,
## car=car=NO} => {pep=pep=NO} 0.015 0.9 1.7 9
## [10] {age=twenties,
## children=2,
## current_act=current_act=YES} => {pep=pep=NO} 0.030 0.9 1.7 18
## [11] {age=teens,
## income=(5.01e+03,2.44e+04],
## children=2,
## current_act=current_act=YES} => {pep=pep=NO} 0.015 0.9 1.7 9
## [12] {age=teens,
## region=INNER_CITY,
## income=(5.01e+03,2.44e+04],
## save_act=save_act=YES} => {pep=pep=NO} 0.015 0.9 1.7 9
## [13] {age=teens,
## sex=FEMALE,
## married=married=YES,
## mortgage=mortgage=NO} => {pep=pep=NO} 0.015 0.9 1.7 9
## [14] {age=teens,
## sex=FEMALE,
## save_act=save_act=YES,
## current_act=current_act=YES} => {pep=pep=NO} 0.015 0.9 1.7 9
## [15] {region=SUBURBAN,
## married=married=YES,
## children=0,
## mortgage=mortgage=NO} => {pep=pep=NO} 0.015 0.9 1.7 9
## [16] {age=twenties,
## income=(5.01e+03,2.44e+04],
## children=3,
## car=car=NO} => {pep=pep=NO} 0.015 0.9 1.7 9
## [17] {age=twenties,
## income=(5.01e+03,2.44e+04],
## children=3,
## current_act=current_act=YES} => {pep=pep=NO} 0.015 0.9 1.7 9
## [18] {age=twenties,
## children=3,
## car=car=NO,
## current_act=current_act=YES} => {pep=pep=NO} 0.015 0.9 1.7 9
## [19] {region=TOWN,
## income=(5.01e+03,2.44e+04],
## children=3,
## car=car=NO} => {pep=pep=NO} 0.015 0.9 1.7 9
## [20] {region=TOWN,
## children=3,
## save_act=save_act=YES,
## mortgage=mortgage=NO} => {pep=pep=NO} 0.015 0.9 1.7 9
##Visualize
plotly_arules(norules3, measure = c("support", "lift"), shading = "confidence", jitter = 0
,marker = list(opacity = .9, size = 10, symbol = 17), colors = c("pink", "blue"))
## Warning: 'plotly_arules' is deprecated.
## Use 'plot' instead.
## See help("Deprecated")