PHPackages                             filippo-toso/recommendation - 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. filippo-toso/recommendation

ActiveLibrary

filippo-toso/recommendation
===========================

Simple recommendation library for small projects

v1.0.2(8y ago)115MITPHPPHP ^5.6 || ^7.0

Since Nov 4Pushed 8y agoCompare

[ Source](https://github.com/filippotoso/recommendation)[ Packagist](https://packagist.org/packages/filippo-toso/recommendation)[ RSS](/packages/filippo-toso-recommendation/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Recommendation library
======================

[](#recommendation-library)

A simple recommendation library for small projects. The SimpleEngine supports only the "liked" action (i.e. Philip likes the Caprese pizza). The BinatyEngine supports both "liked" and "disliked" actions (i.e. Philip likes the Verdure pizza but dislikes the Arrabbiata pizza).

Requirements
------------

[](#requirements)

- PHP 5.6+

Installing
----------

[](#installing)

Use Composer to install it:

```
composer require filippo-toso/recommendation

```

Using It
--------

[](#using-it)

```
use FilippoToso\Recommendation\SimpleEngine;
use FilippoToso\Recommendation\BinaryEngine;

/****************** Simple Engine *********************/

// Creating the recommendation engine
$engine = new SimpleEngine();

// Bulk loading the preferences
$preferences = include(__DIR__) . '/data/simple_preferences.php';
$engine->bulk_load($preferences);

// Returns recommendations only for new elements
$engine->option('new', TRUE);

// Returns recommendations sorted
$engine->option('sort', TRUE);

// Preparing the engine
$engine->prepare();

// How much will Philip like the Diavola pizza?
$result = $engine->liking('Philip', 'Diavola');
printf("Philip liking for the Diavola pizza: %f\r\n", $result);

// Get all the recommended pizzas for Philip
print("Philip recommendations: ");
$result = $engine->recommendations('Philip');

// Display recommendations
print_r($result);

// Get all the recommendations for all the users
$result = $engine->recommendations();

// Display recommendations
print_r($result);

print("\r\n");

/****************** Binary Engine *********************/

// Creating the recommendation engine
$engine = new BinaryEngine();

// Bulk loading the preferences
$preferences = include(__DIR__) . '/data/binary_preferences.php';
$engine->bulk_load($preferences);

// Returns recommendations only for new elements
$engine->option('new', TRUE);

// Returns recommendations sorted
$engine->option('sort', TRUE);

// Preparing the engine
$engine->prepare();

// How much will Philip like the Diavola pizza?
$result = $engine->liking('Philip', 'Diavola');
printf("Philip liking for the Diavola pizza: %f\r\n", $result);

// Get all the recommended pizzas for Philip
print("Philip recommendations: ");
$result = $engine->recommendations('Philip');

// Display recommendations
print_r($result);

// Get all the recommendations for all the users
$result = $engine->recommendations();

// Display recommendations
print_r($result);

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3110d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/55d89f2d44fb12225de2119994028ee69e36770bcf33c2b1ddf0d6672d28151b?d=identicon)[filippo.toso](/maintainers/filippo.toso)

---

Top Contributors

[![filippotoso](https://avatars.githubusercontent.com/u/26958813?v=4)](https://github.com/filippotoso "filippotoso (3 commits)")

### Embed Badge

![Health badge](/badges/filippo-toso-recommendation/health.svg)

```
[![Health](https://phpackages.com/badges/filippo-toso-recommendation/health.svg)](https://phpackages.com/packages/filippo-toso-recommendation)
```

PHPackages © 2026

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