predictator/association-rule
Composer 安装命令:
composer require predictator/association-rule
包简介
README 文档
README
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
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
/** @var AssociationRule\Result $item */ foreach ($result as $item) { $item->getAssociationPercent(); $item->getId(); $item->getProduct(); }
Test
predictator.eu
统计信息
- 总下载量: 363
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-02-05