You are here

public function Recommender::retrievePrediction in Recommender API 6.2

File

./Recommender.php, line 413

Class

Recommender
The super class for all other Recommender algorithms.

Code

public function retrievePrediction($mouse, $cheese) {
  $result = @db_query("SELECT prediction FROM {recommender_prediction}\n                WHERE app_id=%d AND mouse_id=%d AND cheese_id=%d", $this->appId, $mouse, $cheese);
  $prediction = db_result($result);

  // return FALSE or NULL could be confused with 0. Therefore, return NAN for error cases.
  return $prediction !== FALSE ? $prediction : NAN;
}