PHP Classes

PHP Apriori Algorithm Data Miner: Reduce a set of transactions to a smaller group

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 44%Total: 496 All time: 5,850 This week: 206Up
Version License PHP version Categories
apriori-miner 0.1GNU General Publi...5Algorithms, PHP 5
Description 

Author

This class can reduce a set of transactions to a smaller group.

It can take a set of transaction items and applies the apriori algorithm to reduce to a smaller group of transactions.

This class can return the frequent item list above a specified minimum support count.

Innovation Award
PHP Programming Innovation award nominee
June 2015
Number 4
The Apriori algorithm is used to process large sets of information in a database by finding frequent individual values and process them to find patterns.

This class is a PHP implementation of the Apriori algorithm for data mining over items of transaction data.

Manuel Lemos
Picture of Dave Smith
  Performance   Level  
Name: Dave Smith is available for providing paid consulting. Contact Dave Smith .
Classes: 51 packages by
Country: United States United States
Age: 59
All time rank: 608 in United States United States
Week rank: 163 Down17 in United States United States Down
Innovation award
Innovation award
Nominee: 32x

Winner: 7x

Recommendations

Code for Apriori Algorithm in PHP OOP
Run the code of Apriori Algorithm in my system

Example

<?php
/*
data mining using apriori algorithm
apriori class 0.1 beta
*/

//include class
include('apriori.class.php');

//instantiate object with minimum support count
$apriori = new apriori(2);

//add transactions with unique Transaction ID, Item List
$apriori->addTransaction('100','{1,3,4}');
$apriori->addTransaction('200','{2,3,5}');
$apriori->addTransaction('300','{1,2,3,5}');
$apriori->addTransaction('400','{2,5}');

//item list does not have to be enclosed in curly brackets
$apriori->addTransaction('500','1,3,5');

//duplicate transaction ID's are ignored
$apriori->addTransaction('300','{2,3,5,6}');


//process transactions
$apriori->processTransactions();

//get frequent item sets in list format
$results = $apriori->formattedSet();

//display
echo 'Number of transactions: '.count($apriori->tranactionList).'<br><br>';
echo
'Number of unique items: '.count($apriori->itemList).'<br><br>';
echo
'Minimun Support Count: '.$apriori->minSupportCount.'<br><br>';
echo
'Number of iterations: '.$apriori->iteration.'<br><br>';
echo
'Frequent item sets<br>';
foreach(
$results as $result){
    echo
$result.'<br>';
}

?>


  Files folder image Files (3)  
File Role Description
Plain text file apriori.class.php Class Main Class
Accessible without login Plain text file example.php Example Example Usage
Accessible without login Plain text file license.txt Lic. License

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:496
This week:0
All time:5,850
This week:206Up
 User Ratings  
 
 All time
Utility:58%StarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:44%StarStarStar
Rank:3494