njuptaaa/problem-recommendation

collaborative filtering recommender systems

dev-main 2022-03-06 03:11 UTC

This package is auto-updated.

Last update: 2024-05-06 08:58:34 UTC


README

NOJ Problem Recommendation based on awesome algorithm by tigoCaval.

Getting started

For PHP >= 7.0, require package using composer:

composer require njuptaaa/problem-recommendation

Supporting Algorithms

  • ranking
  • euclidean
  • slope one

Introduction

Recommend a problem using collaborative filtering:

/**
 * $table gets the array from the database.
 * $user is the foreign key that represents the user who will receive the recommendation.
 */
use NJUPTAAA\ProblemRecommendation\Recommend;

$client = new Recommend();
$client->ranking($table, $user); // optional third parameter refers to the score not accepted
$client->euclidean($table, $user); // optional third parameter refers to the minimum accepted score
$client->slopeOne($table, $user); // optional third parameter refers to the minimum accepted score

Configuration

$client = new Recommend('score', 'pid', 'uid');