dsj <- read.csv("D:/DSJobs_2.csv")
summary(dsj)
## experience_level job_title salary_in_usd emp_continent
## Length:245 Length:245 Min. : 2876 Length:245
## Class :character Class :character 1st Qu.: 45896 Class :character
## Mode :character Mode :character Median : 81000 Mode :character
## Mean : 99868
## 3rd Qu.:130000
## Max. :600000
## remote_ratio company_size Salary.bin
## Min. : 0.00 Length:245 Length:245
## 1st Qu.: 50.00 Class :character Class :character
## Median :100.00 Mode :character Mode :character
## Mean : 69.18
## 3rd Qu.:100.00
## Max. :100.00
#### Upload the libraries Used
library(arules)
## Warning: package 'arules' was built under R version 4.2.1
## Loading required package: Matrix
##
## Attaching package: 'arules'
## The following objects are masked from 'package:base':
##
## abbreviate, write
library("tidygraph")
## Warning: package 'tidygraph' was built under R version 4.2.1
##
## Attaching package: 'tidygraph'
## The following object is masked from 'package:stats':
##
## filter
library(stats)
library(data.table)
## Warning: package 'data.table' was built under R version 4.2.1
library(arulesViz)
## Warning: package 'arulesViz' was built under R version 4.2.1
dsj<- read.transactions("D:/DSJobs_2.csv", sep=",")
summary(dsj)
## transactions as itemMatrix in sparse format with
## 246 rows (elements/itemsets/transactions) and
## 263 columns (items) and a density of 0.02661597
##
## most frequent items:
## 100 L MI N_Amer Europe (Other)
## 134 132 103 103 90 1160
##
## element (itemset/transaction) length distribution:
## sizes
## 7
## 246
##
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 7 7 7 7 7 7
##
## includes extended item information - examples:
## labels
## 1 "<100K"
## 2 "<10K"
## 3 "<15K"
inspect(dsj[1:10])
## items
## [1] {company_size,
## emp_continent,
## experience_level,
## job_title,
## remote_ratio,
## Salary bin,
## salary_in_usd}
## [2] {"<10K",
## 0,
## 2876,
## Data Scientist,
## MI,
## N_Amer,
## S}
## [3] {"<10K",
## 100,
## 4000,
## Asia,
## Data Engineer,
## M,
## MI}
## [4] {"<10K",
## 0,
## 4000,
## Asia,
## Data Scientist,
## EN,
## M}
## [5] {"<10K",
## 3D Computer Vision Researcher,
## 50,
## 5423,
## Asia,
## M,
## MI}
## [6] {"<10K",
## 100,
## 5695,
## Asia,
## Data Scientist,
## MI,
## S}
## [7] {"<10K",
## 50,
## 5707,
## Asia,
## Data Science Consultant,
## EN,
## M}
## [8] {"<10K",
## 0,
## 5898,
## Asia,
## Big Data Engineer,
## EN,
## L}
## [9] {"<10K",
## 0,
## 6072,
## Asia,
## Data Analyst,
## EN,
## S}
## [10] {"<10K",
## 100,
## 6072,
## Asia,
## L,
## MI,
## Product Data Analyst}
itemFrequency(dsj[,1:5])
## "<100K" "<10K" "<15K" "<200K" "<20K"
## 0.21138211 0.04471545 0.02845528 0.30081301 0.02845528
itemFrequencyPlot(dsj, support=0.1, main="Items with 0.1 support")
itemFrequencyPlot(dsj, topN=20, type = "absolute", main = "Top 20 most frequent Items")
#### Use Association Rules to check support and confidence and run
summary
DcRules <- apriori(data = dsj, parameter = list(support=0.1, confidence=0.8, minlen=1))
## Apriori
##
## Parameter specification:
## confidence minval smax arem aval originalSupport maxtime support minlen
## 0.8 0.1 1 none FALSE TRUE 5 0.1 1
## maxlen target ext
## 10 rules TRUE
##
## Algorithmic control:
## filter tree heap memopt load sort verbose
## 0.1 TRUE TRUE FALSE TRUE 2 TRUE
##
## Absolute minimum support count: 24
##
## set item appearances ...[0 item(s)] done [0.00s].
## set transactions ...[263 item(s), 246 transaction(s)] done [0.00s].
## sorting and recoding items ... [18 item(s)] done [0.00s].
## creating transaction tree ... done [0.00s].
## checking subsets of size 1 2 3 4 done [0.00s].
## writing ... [3 rule(s)] done [0.00s].
## creating S4 object ... done [0.00s].
summary(DcRules)
## set of 3 rules
##
## rule length distribution (lhs + rhs):sizes
## 3 4
## 2 1
##
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.000 3.000 3.000 3.333 3.500 4.000
##
## summary of quality measures:
## support confidence coverage lift
## Min. :0.1098 Min. :0.8113 Min. :0.1179 Min. :1.938
## 1st Qu.:0.1280 1st Qu.:0.8243 1st Qu.:0.1463 1st Qu.:1.969
## Median :0.1463 Median :0.8372 Median :0.1748 Median :2.000
## Mean :0.1436 Mean :0.8599 Mean :0.1694 Mean :2.054
## 3rd Qu.:0.1606 3rd Qu.:0.8841 3rd Qu.:0.1951 3rd Qu.:2.112
## Max. :0.1748 Max. :0.9310 Max. :0.2154 Max. :2.224
## count
## Min. :27.00
## 1st Qu.:31.50
## Median :36.00
## Mean :35.33
## 3rd Qu.:39.50
## Max. :43.00
##
## mining info:
## data ntransactions support confidence
## dsj 246 0.1 0.8
## call
## apriori(data = dsj, parameter = list(support = 0.1, confidence = 0.8, minlen = 1))
DcRules<- sort(DcRules, by = "confidence", decreasing = TRUE)
inspect(DcRules[1:3])
## lhs rhs support confidence coverage lift count
## [1] {"<200K", 100, L} => {N_Amer} 0.1097561 0.9310345 0.1178862 2.223636 27
## [2] {"<200K", L} => {N_Amer} 0.1463415 0.8372093 0.1747967 1.999548 36
## [3] {"<200K", 100} => {N_Amer} 0.1747967 0.8113208 0.2154472 1.937718 43
DcRules <- sort(DcRules, by = "lift", decreasing = TRUE)
is.redundant(DcRules, measure = "confidence", confint = TRUE, level = 0.8)
## [1] TRUE FALSE FALSE
Rlindex <- is.redundant(DcRules, measure = "confidence",confint=TRUE, level=0.8)
QRules <- DcRules [-Rlindex]
inspect(QRules[1:2])
## lhs rhs support confidence coverage lift count
## [1] {"<200K", L} => {N_Amer} 0.1463415 0.8372093 0.1747967 1.999548 36
## [2] {"<200K", 100} => {N_Amer} 0.1747967 0.8113208 0.2154472 1.937718 43
DcRules <- apriori(data = dsj, parameter = list(support=0.05, confidence=0.6, minlen=1))
## Apriori
##
## Parameter specification:
## confidence minval smax arem aval originalSupport maxtime support minlen
## 0.6 0.1 1 none FALSE TRUE 5 0.05 1
## maxlen target ext
## 10 rules TRUE
##
## Algorithmic control:
## filter tree heap memopt load sort verbose
## 0.1 TRUE TRUE FALSE TRUE 2 TRUE
##
## Absolute minimum support count: 12
##
## set item appearances ...[0 item(s)] done [0.00s].
## set transactions ...[263 item(s), 246 transaction(s)] done [0.00s].
## sorting and recoding items ... [22 item(s)] done [0.00s].
## creating transaction tree ... done [0.00s].
## checking subsets of size 1 2 3 4 5 done [0.00s].
## writing ... [111 rule(s)] done [0.00s].
## creating S4 object ... done [0.00s].
inspect(DcRules)
## lhs rhs support confidence coverage
## [1] {">200K"} => {N_Amer} 0.07723577 0.9047619 0.08536585
## [2] {">200K"} => {L} 0.06910569 0.8095238 0.08536585
## [3] {">200K"} => {100} 0.06097561 0.7142857 0.08536585
## [4] {"<50K"} => {Europe} 0.06910569 0.6538462 0.10569106
## [5] {"<50K"} => {MI} 0.06910569 0.6538462 0.10569106
## [6] {"<70K"} => {Europe} 0.08943089 0.7096774 0.12601626
## [7] {Data Engineer} => {MI} 0.09756098 0.6315789 0.15447154
## [8] {Data Engineer} => {L} 0.09349593 0.6052632 0.15447154
## [9] {S} => {100} 0.14227642 0.6034483 0.23577236
## [10] {50} => {Europe} 0.17479675 0.6056338 0.28861789
## [11] {50} => {L} 0.18699187 0.6478873 0.28861789
## [12] {"<200K"} => {N_Amer} 0.22357724 0.7432432 0.30081301
## [13] {"<200K"} => {100} 0.21544715 0.7162162 0.30081301
## [14] {MI} => {L} 0.25203252 0.6019417 0.41869919
## [15] {N_Amer} => {L} 0.26829268 0.6407767 0.41869919
## [16] {N_Amer} => {100} 0.30894309 0.7378641 0.41869919
## [17] {">200K", N_Amer} => {L} 0.06504065 0.8421053 0.07723577
## [18] {">200K", L} => {N_Amer} 0.06504065 0.9411765 0.06910569
## [19] {">200K", N_Amer} => {100} 0.06097561 0.7894737 0.07723577
## [20] {">200K", 100} => {N_Amer} 0.06097561 1.0000000 0.06097561
## [21] {">200K", L} => {100} 0.05284553 0.7647059 0.06910569
## [22] {">200K", 100} => {L} 0.05284553 0.8666667 0.06097561
## [23] {"<70K", 50} => {Europe} 0.05691057 0.8235294 0.06910569
## [24] {"<70K", Europe} => {50} 0.05691057 0.6363636 0.08943089
## [25] {Data Engineer, MI} => {L} 0.06910569 0.7083333 0.09756098
## [26] {Data Engineer, L} => {MI} 0.06910569 0.7391304 0.09349593
## [27] {100, Data Engineer} => {MI} 0.05284553 0.6500000 0.08130081
## [28] {Data Engineer, L} => {100} 0.05691057 0.6086957 0.09349593
## [29] {100, Data Engineer} => {L} 0.05691057 0.7000000 0.08130081
## [30] {"<100K", 50} => {L} 0.05284553 0.7222222 0.07317073
## [31] {"<100K", MI} => {L} 0.06910569 0.7391304 0.09349593
## [32] {"<100K", N_Amer} => {100} 0.06504065 0.6956522 0.09349593
## [33] {"<100K", 100} => {N_Amer} 0.06504065 0.6153846 0.10569106
## [34] {EN, S} => {100} 0.06097561 0.6818182 0.08943089
## [35] {EN, N_Amer} => {100} 0.06097561 0.8333333 0.07317073
## [36] {"<200K", M} => {N_Amer} 0.05284553 0.6842105 0.07723577
## [37] {M, N_Amer} => {"<200K"} 0.05284553 0.6190476 0.08536585
## [38] {"<200K", M} => {100} 0.06504065 0.8421053 0.07723577
## [39] {M, N_Amer} => {100} 0.06097561 0.7142857 0.08536585
## [40] {50, Data Scientist} => {Europe} 0.05691057 0.6666667 0.08536585
## [41] {50, Data Scientist} => {L} 0.06097561 0.7142857 0.08536585
## [42] {"<200K", Data Scientist} => {N_Amer} 0.05691057 0.8750000 0.06504065
## [43] {Data Scientist, N_Amer} => {"<200K"} 0.05691057 0.6666667 0.08536585
## [44] {Data Scientist, Europe} => {MI} 0.06097561 0.6000000 0.10162602
## [45] {Data Scientist, L} => {MI} 0.07317073 0.6000000 0.12195122
## [46] {100, Data Scientist} => {MI} 0.06910569 0.6296296 0.10975610
## [47] {Data Scientist, N_Amer} => {L} 0.05284553 0.6190476 0.08536585
## [48] {Data Scientist, N_Amer} => {100} 0.05284553 0.6190476 0.08536585
## [49] {50, SE} => {L} 0.06097561 0.7142857 0.08536585
## [50] {50, MI} => {Europe} 0.08130081 0.6666667 0.12195122
## [51] {50, Europe} => {L} 0.11788618 0.6744186 0.17479675
## [52] {50, L} => {Europe} 0.11788618 0.6304348 0.18699187
## [53] {Europe, L} => {50} 0.11788618 0.6170213 0.19105691
## [54] {50, MI} => {L} 0.08943089 0.7333333 0.12195122
## [55] {"<200K", SE} => {N_Amer} 0.11382114 0.7368421 0.15447154
## [56] {N_Amer, SE} => {"<200K"} 0.11382114 0.6829268 0.16666667
## [57] {"<200K", SE} => {100} 0.10975610 0.7105263 0.15447154
## [58] {"<200K", MI} => {N_Amer} 0.08943089 0.8148148 0.10975610
## [59] {"<200K", MI} => {L} 0.07723577 0.7037037 0.10975610
## [60] {"<200K", MI} => {100} 0.07723577 0.7037037 0.10975610
## [61] {"<200K", N_Amer} => {L} 0.14634146 0.6545455 0.22357724
## [62] {"<200K", L} => {N_Amer} 0.14634146 0.8372093 0.17479675
## [63] {"<200K", N_Amer} => {100} 0.17479675 0.7818182 0.22357724
## [64] {"<200K", 100} => {N_Amer} 0.17479675 0.8113208 0.21544715
## [65] {"<200K", L} => {100} 0.11788618 0.6744186 0.17479675
## [66] {N_Amer, SE} => {L} 0.10975610 0.6585366 0.16666667
## [67] {L, SE} => {N_Amer} 0.10975610 0.6279070 0.17479675
## [68] {N_Amer, SE} => {100} 0.12195122 0.7317073 0.16666667
## [69] {100, SE} => {N_Amer} 0.12195122 0.6521739 0.18699187
## [70] {Europe, MI} => {L} 0.09756098 0.6000000 0.16260163
## [71] {MI, N_Amer} => {L} 0.11788618 0.7250000 0.16260163
## [72] {MI, N_Amer} => {100} 0.10975610 0.6750000 0.16260163
## [73] {L, N_Amer} => {100} 0.19918699 0.7424242 0.26829268
## [74] {100, N_Amer} => {L} 0.19918699 0.6447368 0.30894309
## [75] {100, L} => {N_Amer} 0.19918699 0.7101449 0.28048780
## [76] {">200K", L, N_Amer} => {100} 0.05284553 0.8125000 0.06504065
## [77] {">200K", 100, N_Amer} => {L} 0.05284553 0.8666667 0.06097561
## [78] {">200K", 100, L} => {N_Amer} 0.05284553 1.0000000 0.05284553
## [79] {50, Europe, MI} => {L} 0.06504065 0.8000000 0.08130081
## [80] {50, L, MI} => {Europe} 0.06504065 0.7272727 0.08943089
## [81] {Europe, L, MI} => {50} 0.06504065 0.6666667 0.09756098
## [82] {"<200K", N_Amer, SE} => {L} 0.07723577 0.6785714 0.11382114
## [83] {"<200K", L, SE} => {N_Amer} 0.07723577 1.0000000 0.07723577
## [84] {L, N_Amer, SE} => {"<200K"} 0.07723577 0.7037037 0.10975610
## [85] {"<200K", N_Amer, SE} => {100} 0.08536585 0.7500000 0.11382114
## [86] {"<200K", 100, SE} => {N_Amer} 0.08536585 0.7777778 0.10975610
## [87] {100, N_Amer, SE} => {"<200K"} 0.08536585 0.7000000 0.12195122
## [88] {"<200K", L, SE} => {100} 0.05284553 0.6842105 0.07723577
## [89] {"<200K", MI, N_Amer} => {L} 0.06504065 0.7272727 0.08943089
## [90] {"<200K", L, MI} => {N_Amer} 0.06504065 0.8421053 0.07723577
## [91] {"<200K", MI, N_Amer} => {100} 0.06910569 0.7727273 0.08943089
## [92] {"<200K", 100, MI} => {N_Amer} 0.06910569 0.8947368 0.07723577
## [93] {100, MI, N_Amer} => {"<200K"} 0.06910569 0.6296296 0.10975610
## [94] {"<200K", L, MI} => {100} 0.05284553 0.6842105 0.07723577
## [95] {"<200K", 100, MI} => {L} 0.05284553 0.6842105 0.07723577
## [96] {"<200K", L, N_Amer} => {100} 0.10975610 0.7500000 0.14634146
## [97] {"<200K", 100, N_Amer} => {L} 0.10975610 0.6279070 0.17479675
## [98] {"<200K", 100, L} => {N_Amer} 0.10975610 0.9310345 0.11788618
## [99] {L, N_Amer, SE} => {100} 0.07723577 0.7037037 0.10975610
## [100] {100, N_Amer, SE} => {L} 0.07723577 0.6333333 0.12195122
## [101] {100, L, SE} => {N_Amer} 0.07723577 0.7916667 0.09756098
## [102] {L, MI, N_Amer} => {100} 0.08943089 0.7586207 0.11788618
## [103] {100, MI, N_Amer} => {L} 0.08943089 0.8148148 0.10975610
## [104] {100, L, MI} => {N_Amer} 0.08943089 0.7096774 0.12601626
## [105] {"<200K", L, N_Amer, SE} => {100} 0.05284553 0.6842105 0.07723577
## [106] {"<200K", 100, N_Amer, SE} => {L} 0.05284553 0.6190476 0.08536585
## [107] {"<200K", 100, L, SE} => {N_Amer} 0.05284553 1.0000000 0.05284553
## [108] {100, L, N_Amer, SE} => {"<200K"} 0.05284553 0.6842105 0.07723577
## [109] {"<200K", L, MI, N_Amer} => {100} 0.05284553 0.8125000 0.06504065
## [110] {"<200K", 100, MI, N_Amer} => {L} 0.05284553 0.7647059 0.06910569
## [111] {"<200K", 100, L, MI} => {N_Amer} 0.05284553 1.0000000 0.05284553
## lift count
## [1] 2.160888 19
## [2] 1.508658 17
## [3] 1.311301 15
## [4] 1.787179 17
## [5] 1.561613 17
## [6] 1.939785 22
## [7] 1.508431 24
## [8] 1.127990 23
## [9] 1.107823 35
## [10] 1.655399 43
## [11] 1.207426 46
## [12] 1.775125 55
## [13] 1.314845 53
## [14] 1.121801 62
## [15] 1.194175 66
## [16] 1.354586 76
## [17] 1.569378 16
## [18] 2.247858 16
## [19] 1.449332 15
## [20] 2.388350 15
## [21] 1.403863 13
## [22] 1.615152 13
## [23] 2.250980 14
## [24] 2.204866 14
## [25] 1.320076 17
## [26] 1.765302 17
## [27] 1.552427 13
## [28] 1.117456 14
## [29] 1.304545 14
## [30] 1.345960 13
## [31] 1.377470 17
## [32] 1.277093 16
## [33] 1.469754 16
## [34] 1.251696 15
## [35] 1.529851 15
## [36] 1.634134 13
## [37] 2.057915 13
## [38] 1.545954 16
## [39] 1.311301 15
## [40] 1.822222 14
## [41] 1.331169 15
## [42] 2.089806 14
## [43] 2.216216 14
## [44] 1.433010 15
## [45] 1.433010 18
## [46] 1.503776 17
## [47] 1.153680 13
## [48] 1.136461 13
## [49] 1.331169 15
## [50] 1.822222 20
## [51] 1.256871 29
## [52] 1.723188 29
## [53] 2.137848 29
## [54] 1.366667 22
## [55] 1.759836 28
## [56] 2.270270 28
## [57] 1.304399 27
## [58] 1.946063 22
## [59] 1.311448 19
## [60] 1.291874 19
## [61] 1.219835 36
## [62] 1.999548 36
## [63] 1.435278 43
## [64] 1.937718 43
## [65] 1.238112 29
## [66] 1.227273 27
## [67] 1.499661 27
## [68] 1.343284 30
## [69] 1.557619 30
## [70] 1.118182 24
## [71] 1.351136 29
## [72] 1.239179 27
## [73] 1.362958 49
## [74] 1.201555 49
## [75] 1.696074 49
## [76] 1.491604 13
## [77] 1.615152 13
## [78] 2.388350 13
## [79] 1.490909 16
## [80] 1.987879 16
## [81] 2.309859 16
## [82] 1.264610 19
## [83] 2.388350 19
## [84] 2.339339 19
## [85] 1.376866 21
## [86] 1.857605 21
## [87] 2.327027 21
## [88] 1.256088 13
## [89] 1.355372 16
## [90] 2.011242 16
## [91] 1.418589 17
## [92] 2.136944 17
## [93] 2.093093 17
## [94] 1.256088 13
## [95] 1.275120 13
## [96] 1.376866 27
## [97] 1.170190 27
## [98] 2.223636 27
## [99] 1.291874 19
## [100] 1.180303 19
## [101] 1.890777 19
## [102] 1.392692 22
## [103] 1.518519 22
## [104] 1.694958 22
## [105] 1.256088 13
## [106] 1.153680 13
## [107] 2.388350 13
## [108] 2.274538 13
## [109] 1.491604 13
## [110] 1.425134 13
## [111] 2.388350 13
DcRules <- sort(DcRules, by = "lift", decreasing = TRUE)
inspect(DcRules)
## lhs rhs support confidence coverage
## [1] {">200K", 100} => {N_Amer} 0.06097561 1.0000000 0.06097561
## [2] {">200K", 100, L} => {N_Amer} 0.05284553 1.0000000 0.05284553
## [3] {"<200K", L, SE} => {N_Amer} 0.07723577 1.0000000 0.07723577
## [4] {"<200K", 100, L, SE} => {N_Amer} 0.05284553 1.0000000 0.05284553
## [5] {"<200K", 100, L, MI} => {N_Amer} 0.05284553 1.0000000 0.05284553
## [6] {L, N_Amer, SE} => {"<200K"} 0.07723577 0.7037037 0.10975610
## [7] {100, N_Amer, SE} => {"<200K"} 0.08536585 0.7000000 0.12195122
## [8] {Europe, L, MI} => {50} 0.06504065 0.6666667 0.09756098
## [9] {100, L, N_Amer, SE} => {"<200K"} 0.05284553 0.6842105 0.07723577
## [10] {N_Amer, SE} => {"<200K"} 0.11382114 0.6829268 0.16666667
## [11] {"<70K", 50} => {Europe} 0.05691057 0.8235294 0.06910569
## [12] {">200K", L} => {N_Amer} 0.06504065 0.9411765 0.06910569
## [13] {"<200K", 100, L} => {N_Amer} 0.10975610 0.9310345 0.11788618
## [14] {Data Scientist, N_Amer} => {"<200K"} 0.05691057 0.6666667 0.08536585
## [15] {"<70K", Europe} => {50} 0.05691057 0.6363636 0.08943089
## [16] {">200K"} => {N_Amer} 0.07723577 0.9047619 0.08536585
## [17] {Europe, L} => {50} 0.11788618 0.6170213 0.19105691
## [18] {"<200K", 100, MI} => {N_Amer} 0.06910569 0.8947368 0.07723577
## [19] {100, MI, N_Amer} => {"<200K"} 0.06910569 0.6296296 0.10975610
## [20] {"<200K", Data Scientist} => {N_Amer} 0.05691057 0.8750000 0.06504065
## [21] {M, N_Amer} => {"<200K"} 0.05284553 0.6190476 0.08536585
## [22] {"<200K", L, MI} => {N_Amer} 0.06504065 0.8421053 0.07723577
## [23] {"<200K", L} => {N_Amer} 0.14634146 0.8372093 0.17479675
## [24] {50, L, MI} => {Europe} 0.06504065 0.7272727 0.08943089
## [25] {"<200K", MI} => {N_Amer} 0.08943089 0.8148148 0.10975610
## [26] {"<70K"} => {Europe} 0.08943089 0.7096774 0.12601626
## [27] {"<200K", 100} => {N_Amer} 0.17479675 0.8113208 0.21544715
## [28] {100, L, SE} => {N_Amer} 0.07723577 0.7916667 0.09756098
## [29] {"<200K", 100, SE} => {N_Amer} 0.08536585 0.7777778 0.10975610
## [30] {50, Data Scientist} => {Europe} 0.05691057 0.6666667 0.08536585
## [31] {50, MI} => {Europe} 0.08130081 0.6666667 0.12195122
## [32] {"<50K"} => {Europe} 0.06910569 0.6538462 0.10569106
## [33] {"<200K"} => {N_Amer} 0.22357724 0.7432432 0.30081301
## [34] {Data Engineer, L} => {MI} 0.06910569 0.7391304 0.09349593
## [35] {"<200K", SE} => {N_Amer} 0.11382114 0.7368421 0.15447154
## [36] {50, L} => {Europe} 0.11788618 0.6304348 0.18699187
## [37] {100, L} => {N_Amer} 0.19918699 0.7101449 0.28048780
## [38] {100, L, MI} => {N_Amer} 0.08943089 0.7096774 0.12601626
## [39] {50} => {Europe} 0.17479675 0.6056338 0.28861789
## [40] {"<200K", M} => {N_Amer} 0.05284553 0.6842105 0.07723577
## [41] {">200K", 100} => {L} 0.05284553 0.8666667 0.06097561
## [42] {">200K", 100, N_Amer} => {L} 0.05284553 0.8666667 0.06097561
## [43] {">200K", N_Amer} => {L} 0.06504065 0.8421053 0.07723577
## [44] {"<50K"} => {MI} 0.06910569 0.6538462 0.10569106
## [45] {100, SE} => {N_Amer} 0.12195122 0.6521739 0.18699187
## [46] {100, Data Engineer} => {MI} 0.05284553 0.6500000 0.08130081
## [47] {"<200K", M} => {100} 0.06504065 0.8421053 0.07723577
## [48] {EN, N_Amer} => {100} 0.06097561 0.8333333 0.07317073
## [49] {100, MI, N_Amer} => {L} 0.08943089 0.8148148 0.10975610
## [50] {">200K"} => {L} 0.06910569 0.8095238 0.08536585
## [51] {Data Engineer} => {MI} 0.09756098 0.6315789 0.15447154
## [52] {100, Data Scientist} => {MI} 0.06910569 0.6296296 0.10975610
## [53] {L, SE} => {N_Amer} 0.10975610 0.6279070 0.17479675
## [54] {">200K", L, N_Amer} => {100} 0.05284553 0.8125000 0.06504065
## [55] {"<200K", L, MI, N_Amer} => {100} 0.05284553 0.8125000 0.06504065
## [56] {50, Europe, MI} => {L} 0.06504065 0.8000000 0.08130081
## [57] {"<100K", 100} => {N_Amer} 0.06504065 0.6153846 0.10569106
## [58] {">200K", N_Amer} => {100} 0.06097561 0.7894737 0.07723577
## [59] {"<200K", N_Amer} => {100} 0.17479675 0.7818182 0.22357724
## [60] {Data Scientist, Europe} => {MI} 0.06097561 0.6000000 0.10162602
## [61] {Data Scientist, L} => {MI} 0.07317073 0.6000000 0.12195122
## [62] {"<200K", 100, MI, N_Amer} => {L} 0.05284553 0.7647059 0.06910569
## [63] {"<200K", MI, N_Amer} => {100} 0.06910569 0.7727273 0.08943089
## [64] {">200K", L} => {100} 0.05284553 0.7647059 0.06910569
## [65] {L, MI, N_Amer} => {100} 0.08943089 0.7586207 0.11788618
## [66] {"<100K", MI} => {L} 0.06910569 0.7391304 0.09349593
## [67] {"<200K", N_Amer, SE} => {100} 0.08536585 0.7500000 0.11382114
## [68] {"<200K", L, N_Amer} => {100} 0.10975610 0.7500000 0.14634146
## [69] {50, MI} => {L} 0.08943089 0.7333333 0.12195122
## [70] {L, N_Amer} => {100} 0.19918699 0.7424242 0.26829268
## [71] {"<200K", MI, N_Amer} => {L} 0.06504065 0.7272727 0.08943089
## [72] {N_Amer} => {100} 0.30894309 0.7378641 0.41869919
## [73] {MI, N_Amer} => {L} 0.11788618 0.7250000 0.16260163
## [74] {"<100K", 50} => {L} 0.05284553 0.7222222 0.07317073
## [75] {N_Amer, SE} => {100} 0.12195122 0.7317073 0.16666667
## [76] {50, Data Scientist} => {L} 0.06097561 0.7142857 0.08536585
## [77] {50, SE} => {L} 0.06097561 0.7142857 0.08536585
## [78] {Data Engineer, MI} => {L} 0.06910569 0.7083333 0.09756098
## [79] {"<200K"} => {100} 0.21544715 0.7162162 0.30081301
## [80] {"<200K", MI} => {L} 0.07723577 0.7037037 0.10975610
## [81] {">200K"} => {100} 0.06097561 0.7142857 0.08536585
## [82] {M, N_Amer} => {100} 0.06097561 0.7142857 0.08536585
## [83] {100, Data Engineer} => {L} 0.05691057 0.7000000 0.08130081
## [84] {"<200K", SE} => {100} 0.10975610 0.7105263 0.15447154
## [85] {"<200K", MI} => {100} 0.07723577 0.7037037 0.10975610
## [86] {L, N_Amer, SE} => {100} 0.07723577 0.7037037 0.10975610
## [87] {"<100K", N_Amer} => {100} 0.06504065 0.6956522 0.09349593
## [88] {"<200K", 100, MI} => {L} 0.05284553 0.6842105 0.07723577
## [89] {"<200K", N_Amer, SE} => {L} 0.07723577 0.6785714 0.11382114
## [90] {50, Europe} => {L} 0.11788618 0.6744186 0.17479675
## [91] {"<200K", L, SE} => {100} 0.05284553 0.6842105 0.07723577
## [92] {"<200K", L, MI} => {100} 0.05284553 0.6842105 0.07723577
## [93] {"<200K", L, N_Amer, SE} => {100} 0.05284553 0.6842105 0.07723577
## [94] {EN, S} => {100} 0.06097561 0.6818182 0.08943089
## [95] {MI, N_Amer} => {100} 0.10975610 0.6750000 0.16260163
## [96] {"<200K", L} => {100} 0.11788618 0.6744186 0.17479675
## [97] {N_Amer, SE} => {L} 0.10975610 0.6585366 0.16666667
## [98] {"<200K", N_Amer} => {L} 0.14634146 0.6545455 0.22357724
## [99] {50} => {L} 0.18699187 0.6478873 0.28861789
## [100] {100, N_Amer} => {L} 0.19918699 0.6447368 0.30894309
## [101] {N_Amer} => {L} 0.26829268 0.6407767 0.41869919
## [102] {100, N_Amer, SE} => {L} 0.07723577 0.6333333 0.12195122
## [103] {"<200K", 100, N_Amer} => {L} 0.10975610 0.6279070 0.17479675
## [104] {Data Scientist, N_Amer} => {L} 0.05284553 0.6190476 0.08536585
## [105] {"<200K", 100, N_Amer, SE} => {L} 0.05284553 0.6190476 0.08536585
## [106] {Data Scientist, N_Amer} => {100} 0.05284553 0.6190476 0.08536585
## [107] {Data Engineer} => {L} 0.09349593 0.6052632 0.15447154
## [108] {MI} => {L} 0.25203252 0.6019417 0.41869919
## [109] {Europe, MI} => {L} 0.09756098 0.6000000 0.16260163
## [110] {Data Engineer, L} => {100} 0.05691057 0.6086957 0.09349593
## [111] {S} => {100} 0.14227642 0.6034483 0.23577236
## lift count
## [1] 2.388350 15
## [2] 2.388350 13
## [3] 2.388350 19
## [4] 2.388350 13
## [5] 2.388350 13
## [6] 2.339339 19
## [7] 2.327027 21
## [8] 2.309859 16
## [9] 2.274538 13
## [10] 2.270270 28
## [11] 2.250980 14
## [12] 2.247858 16
## [13] 2.223636 27
## [14] 2.216216 14
## [15] 2.204866 14
## [16] 2.160888 19
## [17] 2.137848 29
## [18] 2.136944 17
## [19] 2.093093 17
## [20] 2.089806 14
## [21] 2.057915 13
## [22] 2.011242 16
## [23] 1.999548 36
## [24] 1.987879 16
## [25] 1.946063 22
## [26] 1.939785 22
## [27] 1.937718 43
## [28] 1.890777 19
## [29] 1.857605 21
## [30] 1.822222 14
## [31] 1.822222 20
## [32] 1.787179 17
## [33] 1.775125 55
## [34] 1.765302 17
## [35] 1.759836 28
## [36] 1.723188 29
## [37] 1.696074 49
## [38] 1.694958 22
## [39] 1.655399 43
## [40] 1.634134 13
## [41] 1.615152 13
## [42] 1.615152 13
## [43] 1.569378 16
## [44] 1.561613 17
## [45] 1.557619 30
## [46] 1.552427 13
## [47] 1.545954 16
## [48] 1.529851 15
## [49] 1.518519 22
## [50] 1.508658 17
## [51] 1.508431 24
## [52] 1.503776 17
## [53] 1.499661 27
## [54] 1.491604 13
## [55] 1.491604 13
## [56] 1.490909 16
## [57] 1.469754 16
## [58] 1.449332 15
## [59] 1.435278 43
## [60] 1.433010 15
## [61] 1.433010 18
## [62] 1.425134 13
## [63] 1.418589 17
## [64] 1.403863 13
## [65] 1.392692 22
## [66] 1.377470 17
## [67] 1.376866 21
## [68] 1.376866 27
## [69] 1.366667 22
## [70] 1.362958 49
## [71] 1.355372 16
## [72] 1.354586 76
## [73] 1.351136 29
## [74] 1.345960 13
## [75] 1.343284 30
## [76] 1.331169 15
## [77] 1.331169 15
## [78] 1.320076 17
## [79] 1.314845 53
## [80] 1.311448 19
## [81] 1.311301 15
## [82] 1.311301 15
## [83] 1.304545 14
## [84] 1.304399 27
## [85] 1.291874 19
## [86] 1.291874 19
## [87] 1.277093 16
## [88] 1.275120 13
## [89] 1.264610 19
## [90] 1.256871 29
## [91] 1.256088 13
## [92] 1.256088 13
## [93] 1.256088 13
## [94] 1.251696 15
## [95] 1.239179 27
## [96] 1.238112 29
## [97] 1.227273 27
## [98] 1.219835 36
## [99] 1.207426 46
## [100] 1.201555 49
## [101] 1.194175 66
## [102] 1.180303 19
## [103] 1.170190 27
## [104] 1.153680 13
## [105] 1.153680 13
## [106] 1.136461 13
## [107] 1.127990 23
## [108] 1.121801 62
## [109] 1.118182 24
## [110] 1.117456 14
## [111] 1.107823 35
somerules<-subset(DcRules, subset=items %in% "Europe")
inspect(somerules)
## lhs rhs support confidence coverage
## [1] {Europe, L, MI} => {50} 0.06504065 0.6666667 0.09756098
## [2] {"<70K", 50} => {Europe} 0.05691057 0.8235294 0.06910569
## [3] {"<70K", Europe} => {50} 0.05691057 0.6363636 0.08943089
## [4] {Europe, L} => {50} 0.11788618 0.6170213 0.19105691
## [5] {50, L, MI} => {Europe} 0.06504065 0.7272727 0.08943089
## [6] {"<70K"} => {Europe} 0.08943089 0.7096774 0.12601626
## [7] {50, Data Scientist} => {Europe} 0.05691057 0.6666667 0.08536585
## [8] {50, MI} => {Europe} 0.08130081 0.6666667 0.12195122
## [9] {"<50K"} => {Europe} 0.06910569 0.6538462 0.10569106
## [10] {50, L} => {Europe} 0.11788618 0.6304348 0.18699187
## [11] {50} => {Europe} 0.17479675 0.6056338 0.28861789
## [12] {50, Europe, MI} => {L} 0.06504065 0.8000000 0.08130081
## [13] {Data Scientist, Europe} => {MI} 0.06097561 0.6000000 0.10162602
## [14] {50, Europe} => {L} 0.11788618 0.6744186 0.17479675
## [15] {Europe, MI} => {L} 0.09756098 0.6000000 0.16260163
## lift count
## [1] 2.309859 16
## [2] 2.250980 14
## [3] 2.204866 14
## [4] 2.137848 29
## [5] 1.987879 16
## [6] 1.939785 22
## [7] 1.822222 14
## [8] 1.822222 20
## [9] 1.787179 17
## [10] 1.723188 29
## [11] 1.655399 43
## [12] 1.490909 16
## [13] 1.433010 15
## [14] 1.256871 29
## [15] 1.118182 24