PHPackages                             renaldy/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. renaldy/php-fpgrowth

ActiveIsc

renaldy/php-fpgrowth
====================

Modified source from Ivan Rebrov github for PHP implementation of the Frequent Pattern Growth algorithm

1.1(5y ago)1154PHPPHP &gt;=7.0

Since Jan 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/renaldyrizki/fp-growth)[ Packagist](https://packagist.org/packages/renaldy/php-fpgrowth)[ RSS](/packages/renaldy-php-fpgrowth/feed)WikiDiscussions main Synced 6d ago

READMEChangelogDependenciesVersions (3)Used By (0)

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

[](#fp-growth)

A PHP implementation of the Frequent Pattern Growth algorithm. This is modified program from Ivan Rebrov (enzomc/php-fpgrowth).

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

[](#getting-started)

You can install the package with composer: composer require renaldy/php-fpgrowth

Usage
-----

[](#usage)

#### Example

[](#example)

```
use Renaldy\PhpFPGrowth\FPGrowth;

$transactions = [
    ['sp trochess', 'woods antitusif'],
    ['woods antitusif', 'vipro g', 'betadine', 'decolsin', 'bodrex'],
    ['sp trochess', 'vipro g', 'betadine', 'hansaplast', 'kalpanax'],
    ['sp trochess', 'betadine', 'hansaplast'],
    ['woods antitusif', 'sp trochess', 'minyak tawon', 'vipro g'],
    ['vipro g', 'betadine', 'sp trochess', 'woods antitusif'],
    ['sp trochess', 'antangin cair'],
    ['woods antitusif', 'vipro g', 'sp trochess'],
    ['sp trochess', 'woods antitusif', 'betadine'],
    ['woods antitusif', 'vipro g', 'hansaplast'],
];

$support = 0.2;
$confidence = 0.75;

$fpgrowth = new FPGrowth($transactions, $support, $confidence);
$fpgrowth->run();

print_r("=========> Dataset:\n");
print_r($transactions);

print_r("=========> Frequent Itemset:\n");
print_r($fpgrowth->getFrequentItemSet());

print_r("=========> Ordered Item:\n");
print_r($fpgrowth->getOrderedItemSet());

print_r("=========> FP Tree:\n");
print_r($fpgrowth->getTree());

print_r("=========> Frequency Pattern:\n");
print_r($fpgrowth->getPatterns());

print_r("=========> Association Rules:\n");
print_r($fpgrowth->getRules());

```

### Output

[](#output)

### List Transaction (Dataset)

[](#list-transaction-dataset)

```
Array
(
    [0] => Array
        (
            [0] => sp trochess
            [1] => woods antitusif
        )

    [1] => Array
        (
            [0] => woods antitusif
            [1] => vipro g
            [2] => betadine
            [3] => decolsin
            [4] => bodrex
        )

    [2] => Array
        (
            [0] => sp trochess
            [1] => vipro g
            [2] => betadine
            [3] => hansaplast
            [4] => kalpanax
        )

    [3] => Array
        (
            [0] => sp trochess
            [1] => betadine
            [2] => hansaplast
        )

    [4] => Array
        (
            [0] => woods antitusif
            [1] => sp trochess
            [2] => minyak tawon
            [3] => vipro g
        )

    [5] => Array
        (
            [0] => vipro g
            [1] => betadine
            [2] => sp trochess
            [3] => woods antitusif
        )

    [6] => Array
        (
            [0] => sp trochess
            [1] => antangin cair
        )

    [7] => Array
        (
            [0] => woods antitusif
            [1] => vipro g
            [2] => sp trochess
        )

    [8] => Array
        (
            [0] => sp trochess
            [1] => woods antitusif
            [2] => betadine
        )

    [9] => Array
        (
            [0] => woods antitusif
            [1] => vipro g
            [2] => hansaplast
        )

)

```

### Frequent Itemset

[](#frequent-itemset)

```
Array
(
    [sp trochess] => Array
        (
            [qty] => 8
            [support] => 0.8
        )

    [woods antitusif] => Array
        (
            [qty] => 7
            [support] => 0.7
        )

    [vipro g] => Array
        (
            [qty] => 6
            [support] => 0.6
        )

    [betadine] => Array
        (
            [qty] => 5
            [support] => 0.5
        )

    [hansaplast] => Array
        (
            [qty] => 3
            [support] => 0.3
        )

)

```

### Ordered Item

[](#ordered-item)

```
Array
(
    [0] => Array
        (
            [0] => sp trochess
            [1] => woods antitusif
        )

    [1] => Array
        (
            [0] => woods antitusif
            [1] => vipro g
            [2] => betadine
        )

    [2] => Array
        (
            [0] => sp trochess
            [1] => vipro g
            [2] => betadine
            [3] => hansaplast
        )

    [3] => Array
        (
            [0] => sp trochess
            [1] => betadine
            [2] => hansaplast
        )

    [4] => Array
        (
            [0] => sp trochess
            [1] => woods antitusif
            [2] => vipro g
        )

    [5] => Array
        (
            [0] => sp trochess
            [1] => woods antitusif
            [2] => vipro g
            [3] => betadine
        )

    [6] => Array
        (
            [0] => sp trochess
        )

    [7] => Array
        (
            [0] => sp trochess
            [1] => woods antitusif
            [2] => vipro g
        )

    [8] => Array
        (
            [0] => sp trochess
            [1] => woods antitusif
            [2] => betadine
        )

    [9] => Array
        (
            [0] => woods antitusif
            [1] => vipro g
            [2] => hansaplast
        )

)

```

### FP Tree Structure

[](#fp-tree-structure)

```
EnzoMC\PhpFPGrowth\FPNode Object
(
    [value] =>
    [count] =>
    [parent] =>
    [link] =>
    [children] => Array()
)

```

### Frequency Pattern

[](#frequency-pattern)

```
Array
(
    [0] => Array
        (
            [item] => hansaplast
            [frequentPattern] => betadine, hansaplast
            [frequent] => 2
        )

    [1] => Array
        (
            [item] => vipro g
            [frequentPattern] => hansaplast, vipro g
            [frequent] => 2
        )

    [2] => Array
        (
            [item] => sp trochess
            [frequentPattern] => hansaplast, sp trochess
            [frequent] => 2
        )

    [3] => Array
        (
            [item] => sp trochess
            [frequentPattern] => betadine, hansaplast, sp trochess
            [frequent] => 2
        )

    [4] => Array
        (
            [item] => woods antitusif
            [frequentPattern] => betadine, vipro g, woods antitusif
            [frequent] => 2
        )

    [5] => Array
        (
            [item] => woods antitusif
            [frequentPattern] => betadine, sp trochess, woods antitusif
            [frequent] => 2
        )

    [6] => Array
        (
            [item] => vipro g
            [frequentPattern] => betadine, vipro g
            [frequent] => 3
        )

    [7] => Array
        (
            [item] => vipro g
            [frequentPattern] => betadine, sp trochess, vipro g
            [frequent] => 2
        )

    [8] => Array
        (
            [item] => sp trochess
            [frequentPattern] => betadine, sp trochess
            [frequent] => 4
        )

    [9] => Array
        (
            [item] => vipro g
            [frequentPattern] => sp trochess, vipro g
            [frequent] => 4
        )

    [10] => Array
        (
            [item] => woods antitusif
            [frequentPattern] => sp trochess, vipro g, woods antitusif
            [frequent] => 3
        )

    [11] => Array
        (
            [item] => woods antitusif
            [frequentPattern] => vipro g, woods antitusif
            [frequent] => 5
        )

    [12] => Array
        (
            [item] => woods antitusif
            [frequentPattern] => sp trochess, woods antitusif
            [frequent] => 5
        )

)

```

### Association Rules

[](#association-rules)

```
Array
(
    [0] => Array
        (
            [antecedent] => betadine, hansaplast
            [consequent] => sp trochess
            [confidence] => 1
            [support] => 0.2
            [liftRatio] => 0.12500
        )

    [1] => Array
        (
            [antecedent] => hansaplast, sp trochess
            [consequent] => betadine
            [confidence] => 1
            [support] => 0.2
            [liftRatio] => 0.20000
        )

    [2] => Array
        (
            [antecedent] => sp trochess, vipro g
            [consequent] => woods antitusif
            [confidence] => 0.75
            [support] => 0.3
            [liftRatio] => 0.10714
        )
)

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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 ~0 days

Total

2

Last Release

1938d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ad2fa7ea29bdea7d481fbab4f0c388ff192f68fc53ee831f4907b1d6ef36fe4?d=identicon)[renaldyrizkimaulana](/maintainers/renaldyrizkimaulana)

---

Top Contributors

[![renaldyrizki](https://avatars.githubusercontent.com/u/29053258?v=4)](https://github.com/renaldyrizki "renaldyrizki (12 commits)")

### Embed Badge

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

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

PHPackages © 2026

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