Skip to content

Instantly share code, notes, and snippets.

@Nathan-Srivi
Created September 25, 2014 10:20
Show Gist options
  • Save Nathan-Srivi/21aab21cbdf41f1349d2 to your computer and use it in GitHub Desktop.
Save Nathan-Srivi/21aab21cbdf41f1349d2 to your computer and use it in GitHub Desktop.
prediction io show page
<?php session_start();
require_once("vendor/autoload.php");
use PredictionIO\PredictionIOClient;
$client = PredictionIOClient::factory(array("appkey" => "6DzhlG31iEHRo1ThUeIswYoXBHYq825Xg8d8ZooUymdXVLBOvbWRBCyCIhfLEAhs"));
try{
$user_id = 6;
$client->identify($user_id);
$command = $client->getCommand('itemrec_get_top_n', array('pio_engine' => 'movie-recommender', 'pio_n' => 9));
$recommended_movies_raw = $client->execute($command);
echo "<pre>";
print_r( $recommended_movies_raw);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment