-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eclat algorithm for market basket analysis
- Loading branch information
1 parent
2ac4ff8
commit ea3cf0f
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Eclat | ||
|
||
# Data Preprocessing | ||
# install.packages('arules') | ||
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 | ||
rules = eclat(data = dataset, parameter = list(support = 0.003, minlen = 2)) | ||
|
||
# Visualising the results | ||
inspect(sort(rules, by = 'support')[1:10]) |