Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Adaptive Apriori Algorithm 🚀

Overview

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 ($MinSup$) and Minimum Confidence ($MinConf$) based on the statistical distribution of the dataset.

Key Features

  • 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.

📊 Performance Benchmarks

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.

Technologies Used

  • Python 3.12
  • Pandas & NumPy (Data processing)
  • Matplotlib (Data visualization)
  • Itertools (Optimized combination generation)

How It Works

  1. Initial Scan: Computes the support of all individual items.
  2. Statistical Analysis: Calculates the median and standard deviation of those supports.
  3. 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.

Author

**Ferhat Abderrahmane ** Student at USTHB (University of Science and Technology Houari Boumediene).

About

An optimized Python implementation of the Apriori algorithm featuring dynamic and level-wise adaptive thresholding. Designed to reduce noise and boost performance, achieving up to 97% faster execution on medical datasets.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages