-
-
Notifications
You must be signed in to change notification settings - Fork 164
/
Copy patheclat.R
43 lines (21 loc) · 875 Bytes
/
eclat.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Eclat
Eclat algorithm can be used to **mine itemsets that occur frequently** i.e to identify sets of products that are frequently
bought together. The alogrithm uses simple intersection operations for equivalence class clustering with bottom-up lattice traversal.
>aims at finding regularities in the shopping behavior of supermarket and online store customers.
# Data Preprocessing
# install.packages('arules')
```sh
$ library(arules)
$ dataset = read.csv('Market_Basket_Optimisation.csv')
$ dataset = read.transactions('Market_Basket_Optimisation.csv', sep = ',', rm.duplicates = TRUE)
$ summary(dataset)
$ itemFrequencyPlot(dataset, topN = 10)
```
# Training Eclat on the dataset
```sh
rules = eclat(data = dataset, parameter = list(support = 0.003, minlen = 2))
```
# Visualising the results
```sh
inspect(sort(rules, by = 'support')[1:10])
```