NOJ Problem Recommendation based on awesome algorithm by tigoCaval.
For PHP >= 7.0, require package using composer:
composer require njuptaaa/problem-recommendation
- ranking
- euclidean
- slope one
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
$client = new Recommend('score', 'pid', 'uid');