PHPackages                             enzomc/php-fpgrowth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. enzomc/php-fpgrowth

ActiveIsc[Utility &amp; Helpers](/categories/utility)

enzomc/php-fpgrowth
===================

PHP implementation of the Frequent Pattern Growth algorithm

1.1(3y ago)83.2k↓33.3%4[2 PRs](https://github.com/EnzoMC/php-fpgrowth/pulls)PHPPHP &gt;=7.4

Since Jun 17Pushed 2y agoCompare

[ Source](https://github.com/EnzoMC/php-fpgrowth)[ Packagist](https://packagist.org/packages/enzomc/php-fpgrowth)[ RSS](/packages/enzomc-php-fpgrowth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

FP-Growth
=========

[](#fp-growth)

A PHP implementation of the Frequent Pattern Growth algorithm

Getting Started
---------------

[](#getting-started)

You can install the package with composer:

```
composer require enzomc/php-fpgrowth

```

Usage
-----

[](#usage)

#### Run algorithm

[](#run-algorithm)

```
use EnzoMC\PhpFPGrowth\FPGrowth;

$support = 3;
$confidence = 0.7;

$fpgrowth = new FPGrowth($support, $confidence);

$transactions = [
    ['M', 'O', 'N', 'K', 'E', 'Y'],
    ['D', 'O', 'N', 'K', 'E', 'Y'],
    ['M', 'A', 'K', 'E'],
    ['M', 'U', 'C', 'K', 'Y'],
    ['C', 'O', 'O', 'K', 'I', 'E']
];

$fpgrowth->run($transactions);

$patterns = $fpgrowth->getPatterns();
$rules = $fpgrowth->getRules();

```

#### Returned results

[](#returned-results)

Patterns returns as array of arrays like:

```
[
    ['ITEM_1,ITEM_2' => 3],
    ['ITEM_3' => 5],
    ...
]

```

Where key is itemset, value is support of that itemset

Rules returns as array of arrays like:

```
[
    ['ITEM_1,ITEM_2', 'ITEM_3', 0.7],
    ['ITEM_4','ITEM_5', 0.7],
    ...
]

```

Where first value is left path of that rule, second value is right path of that rule and third value is confidence of that rule

#### Result with example transactions

[](#result-with-example-transactions)

`var_dump($patterns);`

```
array(10) {
  ["M"]=>
  int(3)
  ["K,M"]=>
  int(3)
  ["Y"]=>
  int(3)
  ["K,Y"]=>
  int(3)
  ["E,O"]=>
  int(4)
  ["E,K"]=>
  int(4)
  ["E,K,O"]=>
  int(4)
  ["O"]=>
  int(4)
  ["K,O"]=>
  int(4)
  ["K"]=>
  int(5)
}

```

`var_dump($rules);`

```
array(11) {
  [0]=>
  array(3) {
    [0]=>
    string(1) "M"
    [1]=>
    string(1) "K"
    [2]=>
    float(1)
  }
  [1]=>
  array(3) {
    [0]=>
    string(1) "Y"
    [1]=>
    string(1) "K"
    [2]=>
    float(1)
  }
  [2]=>
  array(3) {
    [0]=>
    string(1) "O"
    [1]=>
    string(1) "E"
    [2]=>
    float(1)
  }
  [3]=>
  array(3) {
    [0]=>
    string(1) "K"
    [1]=>
    string(1) "E"
    [2]=>
    float(0.8)
  }
  [4]=>
  array(3) {
    [0]=>
    string(1) "K"
    [1]=>
    string(3) "E,O"
    [2]=>
    float(0.8)
  }
  [5]=>
  array(3) {
    [0]=>
    string(1) "O"
    [1]=>
    string(3) "E,K"
    [2]=>
    float(1)
  }
  [6]=>
  array(3) {
    [0]=>
    string(3) "E,K"
    [1]=>
    string(1) "O"
    [2]=>
    float(1)
  }
  [7]=>
  array(3) {
    [0]=>
    string(3) "E,O"
    [1]=>
    string(1) "K"
    [2]=>
    float(1)
  }
  [8]=>
  array(3) {
    [0]=>
    string(3) "K,O"
    [1]=>
    string(1) "E"
    [2]=>
    float(1)
  }
  [9]=>
  array(3) {
    [0]=>
    string(1) "K"
    [1]=>
    string(1) "O"
    [2]=>
    float(0.8)
  }
  [10]=>
  array(3) {
    [0]=>
    string(1) "O"
    [1]=>
    string(1) "K"
    [2]=>
    float(1)
  }
}

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~400 days

Total

4

Last Release

1325d ago

Major Versions

0.1 → 1.02019-06-17

PHP version history (2 changes)0.1PHP &gt;=7.0

v1.1.x-devPHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39695551?v=4)[Ivan Rebrov](/maintainers/enzomc)[@EnzoMC](https://github.com/EnzoMC)

---

Top Contributors

[![EnzoMC](https://avatars.githubusercontent.com/u/39695551?v=4)](https://github.com/EnzoMC "EnzoMC (14 commits)")

### Embed Badge

![Health badge](/badges/enzomc-php-fpgrowth/health.svg)

```
[![Health](https://phpackages.com/badges/enzomc-php-fpgrowth/health.svg)](https://phpackages.com/packages/enzomc-php-fpgrowth)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
