You are here

function recommender_top_prediction in Recommender API 6.2

Same name and namespace in other branches
  1. 6.3 recommender.module \recommender_top_prediction()
  2. 7.3 recommender.module \recommender_top_prediction()
  3. 7.4 recommender.module \recommender_top_prediction()

Return a list of items that are top prediction for $id

Parameters

$app_name The $app_name for the depending modules:

$id usually the $node_id of the target item.:

$top_n how many predictions to return:

$test_func optional function to test whether an item satisfy some conditions:

Return value

an array of the most similar items to $id.

File

./recommender.module, line 159

Code

function recommender_top_prediction($app_name, $id, $top_n, $test_func = NULL) {

  // create a null recommender to access the topPrediction() function.
  $recommender = new Recommender($app_name, NULL, NULL, NULL, NULL);
  return $recommender
    ->topPrediction($id, $top_n, $test_func);
}