https://github.com/moataz-elmesmary/apriori-algorithm-and-association-rule-mining
Market Basket Analysis on Egyptian grocery transaction data using the Apriori algorithm and association rule mining. It visualizes the strongest rules using Arabic labels in both bar charts and network graphs.
https://github.com/moataz-elmesmary/apriori-algorithm-and-association-rule-mining
apriori-algorithm association-rules data-mining
Last synced: 3 days ago
JSON representation
Market Basket Analysis on Egyptian grocery transaction data using the Apriori algorithm and association rule mining. It visualizes the strongest rules using Arabic labels in both bar charts and network graphs.
- Host: GitHub
- URL: https://github.com/moataz-elmesmary/apriori-algorithm-and-association-rule-mining
- Owner: Moataz-Elmesmary
- License: mit
- Created: 2025-04-29T17:01:38.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-04-29T17:46:14.000Z (about 2 months ago)
- Last Synced: 2025-06-14T02:04:00.927Z (5 days ago)
- Topics: apriori-algorithm, association-rules, data-mining
- Language: Jupyter Notebook
- Homepage:
- Size: 507 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π Egyptian Grocery Market Basket Analysis (Association Rules)
This project performs **Market Basket Analysis** on Egyptian grocery transaction data using the **Apriori algorithm** and **association rule mining**. It visualizes the strongest rules using Arabic labels in both bar charts and network graphs.
## π Project Overview
- Extract frequent itemsets using the Apriori algorithm.
- Generate association rules with key metrics: **support**, **confidence**, **lift**, etc.
- Filter and classify rules into **strong** and **weak** based on confidence and lift thresholds.
- Visualize the top 20 strongest rules:
- π¨ Bar Chart based on Lift
- πΈοΈ Directed Network Graph showing item relationships## π§ Techniques Used
- **Apriori Algorithm** for discovering frequent itemsets.
- **Association Rule Mining** via `mlxtend`.
- **Arabic Text Handling**:
- `arabic_reshaper` for reshaping Arabic words.
- `python-bidi` for proper right-to-left display in visualizations.## π οΈ Libraries Used
```python
pandas, numpy, matplotlib, seaborn
mlxtend.frequent_patterns
networkx
arabic_reshaper
bidi.algorithm
```π Visualizations
πΉ Network Graph

πΉ Top 20 Rules by Lift (Bar Chart)
