PHPackages                             predictator/association-rule - 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. predictator/association-rule

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

predictator/association-rule
============================

1.2.0(9y ago)2363MITPHPPHP &gt;= 7.0

Since Feb 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/predictator/association-rule)[ Packagist](https://packagist.org/packages/predictator/association-rule)[ RSS](/packages/predictator-association-rule/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (0)

Association rule
================

[](#association-rule)

Usage
-----

[](#usage)

```
$assoc = new AssociationRule();

$product1 = new AssociationRule\Product(10);
$product2 = new AssociationRule\Product(11);
$product3 = new AssociationRule\Product(12);

$order1 = new AssociationRule\Order(1);
$order1->addOrderItem($product1);
$order1->addOrderItem($product2);
$assoc->addOrder($order1);

$order2 = new AssociationRule\Order(2);
$order2->addOrderItem($product1);
$assoc->addOrder($order2);

$order3 = new AssociationRule\Order(3);
$order3->addOrderItem($product2);
$order3->addOrderItem($product3);
$assoc->addOrder($order3);

$result = $assoc->getResult(new AssociationRule\Product(10));
```

### Exporting model

[](#exporting-model)

You can export model for efficient serving. Model consume less memory, and serve response faster.

```
$model = $assoc->exportModel(new AssociationRule\AssociationModel());
$result = $model->getResult(new AssociationRule\Product(10));
```

### Process result

[](#process-result)

```
/** @var AssociationRule\Result $item */
foreach ($result as $item) {
	$item->getAssociationPercent();
	$item->getId();
	$item->getProduct();
}
```

Test
----

[](#test)

[![Build Status](https://camo.githubusercontent.com/a2a65a62e3bc80a825fd3012de62fd2b668eec986c2493ec607115851b966533/68747470733a2f2f7472617669732d63692e6f72672f7072656469637461746f722f6173736f63696174696f6e2d72756c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/predictator/association-rule)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/958cf040885552346c5a231996b00ce4529deac152b70f2791f3dcb7013a1b32/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7072656469637461746f722f6173736f63696174696f6e2d72756c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/predictator/association-rule/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/425fd844fdac194d384af8ce7823fe0d09eb0e8986ed04ebb2f6549124a78761/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7072656469637461746f722f6173736f63696174696f6e2d72756c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/predictator/association-rule/?branch=master)

predictator.eu

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

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

Total

6

Last Release

3425d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c5ea6e7d8143a1fba541e1f41419cf36a4f970806d4bd91094d3b46177aea6d?d=identicon)[systream](/maintainers/systream)

---

Top Contributors

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

---

Tags

predictionsassociation rule

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/predictator-association-rule/health.svg)

```
[![Health](https://phpackages.com/badges/predictator-association-rule/health.svg)](https://phpackages.com/packages/predictator-association-rule)
```

###  Alternatives

[mult1mate/cron-manager

Flexible cron tasks manager for MVC-type applications

40239.1k3](/packages/mult1mate-cron-manager)[frosh/development-helper

Development Helper

89308.1k](/packages/frosh-development-helper)[awcodes/richer-editor

A collection of extensions and tools to enhance the Filament Rich Editor field.

399.0k8](/packages/awcodes-richer-editor)

PHPackages © 2026

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