njuptaaa/problem-recommendation

协同过滤推荐系统

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

This package is auto-updated.

Last update: 2024-09-06 09:48:12 UTC


README

基于tigoCaval的出色算法的NOJ问题推荐tigoCaval.

入门指南

对于PHP >= 7.0,使用Composer安装包

composer require njuptaaa/problem-recommendation

支持的算法

  • 排名
  • 欧几里得
  • 斜率一

介绍

使用协同过滤推荐问题

/**
 * $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');