This project introduces an optimized version of the Apriori Algorithm for Association Rule Mining. Instead of relying on arbitrary, manually-set parameters, this implementation uses Dynamic Thresholding to automatically calculate the optimal Minimum Support (
-
Dynamic Parameter Calculation: Uses the median and standard deviation (
$\sigma$ ) of item frequencies to set thresholds tailored to the dataset's density. -
Adaptive Level-Wise Approach: Recalculates thresholds at each level (
$k=1, 2, 3...$ ) to prioritize high-quality rules and aggressively prune the search space. - High Performance: Significant reduction in computational overhead, making it ideal for large or dense datasets.
- Medical Insights: Tested on heart disease data to identify significant correlations between symptoms and diagnoses.
Tested on the heart_nominal.csv dataset (988 transactions):
| Metric | Classic Apriori | Dynamic Hybrid | Adaptive Version |
|---|---|---|---|
| Patterns Found | 165 | 49 | 22 |
| Rules Generated | 107 | 15 | 8 |
| Avg. Support | 0.249 | 0.371 | 0.402 |
| Execution Time | 4.878s | 0.492s | 0.124s |
Result: The Adaptive version achieved a 97.4% speed increase compared to the classic approach.
- Python 3.12
- Pandas & NumPy (Data processing)
- Matplotlib (Data visualization)
- Itertools (Optimized combination generation)
- Initial Scan: Computes the support of all individual items.
- Statistical Analysis: Calculates the median and standard deviation of those supports.
-
Adaptive Pruning: Sets a high
$MinSup$ for the initial levels to filter out "noise" and lowers it as itemsets become more complex, ensuring only the most relevant patterns are explored.
**Ferhat Abderrahmane ** Student at USTHB (University of Science and Technology Houari Boumediene).