Blog Post

Apriori Algorithm

Apriori Algorithm

Data Mining



What is Data Mining?


  • Automatically searching large data to find patterns and trends that go beyond simple analysis.

  • Using sophisticated mathematical algorithms, artificial intelligence, statistical. analysis, and database systems to find patterns.

  • Predicts  likely outcomes.

***Algorithms are the core of Data Mining***


Data Mining Algorithms


  • Apriori***

  • Linear Regression

  • Logistic Regression

  • K-means

  • SVMs

  • Random Forests

  • Matrix Factorization



The APRIORI ALGORITHM keeps track of the frequency of item in a database. These frequent items are then used to determine patterns in the large data. These databases contain transactions data. The apriori uses breadth-first search and Hash tree structures to count the frequency data items.


Apriori algorithm for Data Mining – made simple

Great Explanation of How Apriori works and What it is used for




How to Run the Apriori Algorithm in Java Using Blue J




  • Download Blue J which is a free Java Development Environment designed for. beginners, used by millions worldwide.

  • Dowload Link

  • Make sure to get the correct version for your OS that includes JDK

  • Next run the executable and install Blue J.







  • Once You have Blue J installed open Blue J and under Project select new Project and name it Apriori Algorithm.

  • Add a new class and name  it Apriori.




  • Next open up the apriori class folder and select all the text and cut it.





  • Next we will get the source code from this link:


  • Copy and paste the code from the above link into your empty apriori class.

  • Make sure you copy all the code from line 1 to line 315.






  • Next download the chess.dat file and save it into your apriori algorithm folder that was created when we created the new project in BlueJ.

  • Next compile your code and run the program by right-clicking on your apriori class and clicking on the method void main(String[] args) and then click ok on the method call window pop up.

  • Your algorithm should get to work and compute hundreds of computations in a matter of seconds.

  • Scroll down to the writing in RED and it will give you information about your chess.dat file which contain rows with numbers. Each row represents a transaction




Data Mining in  the Real World


  • IBM offers businesses data mining of Twitter


  • Data Mining Reveals When a Yellow Taxi Is Cheaper Than Uber




No comments