Download the PHP package quellabs/recommender without Composer

On this page you can find all versions of the php package quellabs/recommender. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package recommender

quellabs/recommender

Collaborative filtering recommendation engine for PHP 8.2+, built on the CakePHP 5 database layer. Implements two complementary algorithms:

Based on the Vogoo PHP recommendation engine (2007–2008) by Stéphane Droux, modernised for PHP 8.2+ and the Quellabs ecosystem.


Requirements

Installation

Setup

1. Publish the configuration file

This copies config/recommender.php to your project root. Edit it to tune the engine constants. Database credentials are read from config/database.php, which is shared with other Canvas packages.

2. Create the database tables

Creates vogoo_ratings and vogoo_links. Use --force to drop and recreate existing tables.

3. Populate the link table

If you have existing ratings, rebuild the link table from scratch:

To rebuild a single category only:

Database schema

vogoo_ratings

Stores member/product ratings.

Column Type Description
member_id INT UNSIGNED Your application's user ID
product_id INT UNSIGNED Your application's product/item ID
category INT UNSIGNED Category grouping (default: 1)
rating FLOAT 0.0–1.0, or -1.0 for "not interested"
ts DATETIME Last updated timestamp

vogoo_links

Stores pre-computed item co-occurrence counts and Slope One diff values. Populated by the rebuild command or maintained incrementally.

Column Type Description
item_id1 INT UNSIGNED First item in the pair
item_id2 INT UNSIGNED Second item in the pair
category INT UNSIGNED Category grouping
cnt INT Co-occurrence count
diff_slope FLOAT Accumulated Slope One rating differential

Configuration

All options with their defaults:

direct_links and direct_slope are independent. You can enable either or both:

direct_links direct_slope
Powers getLinkedItems(), memberGetRecommendedItems() getSlopeItems(), memberPredict(), memberPredictAll()
Counts Co-occurrence (liked pairs only) All rated pairs

When both are false, vogoo_links is read-only at runtime and must be rebuilt manually.

Usage

With Canvas (autowired)

RecommendationEngine and ItemRecommender are resolved automatically by the Canvas DI container — their constructors depend only on Connection (provided by quellabs/canvas-database) and RecommendationConfig (provided by this package), so no manual wiring is required:

Standalone


API reference

RecommendationEngine

Handles rating CRUD. All write methods trigger incremental link/slope updates when direct_links or direct_slope is enabled.

ItemRecommender

Item-based CF and Slope One recommendations.

All methods accept an optional $filter (array of allowed product IDs), $limit, and $category parameter.

UserSimilarity

User-based CF. Similarity scores range from 0 (no overlap) to 100 (identical taste).

Note: getNeighbours() computes similarity against every candidate neighbour in PHP. For large member sets, pre-compute and cache neighbour lists.

VisitorContext

Holds in-memory ratings for anonymous visitors. Persist and restore it across requests via session serialization.

Statistics

Sculpt CLI commands

Command Description
sculpt recommender:init Publish config/recommender.php
sculpt recommender:init-db Create vogoo_ratings and vogoo_links tables
sculpt recommender:init-db --force Drop and recreate tables
sculpt recommender:rebuild-links Rebuild vogoo_links from all ratings
sculpt recommender:rebuild-links --category=N Rebuild a single category

Multi-category support

Every method accepts an optional ?int $category parameter. When omitted it falls back to the category value in RecommendationConfig (default: 1). To work with multiple catalogues, either pass the category explicitly or instantiate separate RecommendationConfig objects per category:

License

MIT


All versions of recommender with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
cakephp/database Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package quellabs/recommender contains the following files

Loading the files please wait ...