2017 © Pedro Peláez
 

library predictionio

Apache PredictionIO API PHP Client

image

predictionio/predictionio

Apache PredictionIO API PHP Client

  • Monday, March 19, 2018
  • by dszeto
  • Repository
  • 36 Watchers
  • 253 Stars
  • 112,474 Installations
  • PHP
  • 11 Dependents
  • 0 Suggesters
  • 60 Forks
  • 2 Open issues
  • 15 Versions
  • 5 % Grown

The README.md

Apache PredictionIO PHP SDK

Build
Status, (*1)

Prerequisites

  • PHP 5.6+ (http://php.net/)
  • PHP: cURL (http://php.net/manual/en/book.curl.php)
  • Phing (http://www.phing.info/)
  • ApiGen (http://apigen.org/)

Note: This SDK only supports Apache PredictionIO version 0.8.2 or higher., (*2)

Getting Started

The easiest way to install PredictionIO PHP client is to use Composer., (*3)

  1. predictionio is available on Packagist and can be installed using Composer:, (*4)

    composer require predictionio/predictionio
  2. Include Composer's autoloader in your PHP code, (*5)

    require_once("vendor/autoload.php");

Usage

This package is a web service client based on Guzzle. A few quick examples are shown below., (*6)

Instantiate PredictionIO API Event Client

use predictionio\EventClient;
$accessKey = 'j4jIdbq59JsF2f4CXwwkIiVHNFnyNvWXqMqXxcIbQDqFRz5K0fe9e3QfqjKwvW3O';
$client = new EventClient($accessKey, 'http://localhost:7070');

Set a User Record from Your App

// assume you have a user with user ID 5
$response = $client->setUser(5);

Set an Item Record from Your App

// assume you have a book with ID 'bookId1' and we assign 1 as the type ID for book
$response = $client->setItem('bookId1', array('itypes' => 1));

Import a User Action (View) form Your App

// assume this user has viewed this book item
$client->recordUserActionOnItem('view', 5, 'bookId1');

Retrieving Prediction Result

// assume you have created an itemrank engine on localhost:8000
// we try to get ranking of 5 items (item IDs: 1, 2, 3, 4, 5) for a user (user ID 7)

$engineClient = new EngineClient('http://localhost:8000');
$response = $engineClient->sendQuery(array('uid'=>7, 'iids'=>array(1,2,3,4,5)));

print_r($response);

Bugs and Feature Requests

Use Apache JIRA to report bugs or request new features., (*7)

Community

Keep track of development and community news., (*8)

Contributing

Read the Contribute Code page., (*9)

License

Apache PredictionIO is under Apache 2 license., (*10)

The Versions

19/03 2018

dev-master

9999999-dev http://predictionio.apache.org

Apache PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

19/03 2018

v0.9.1

0.9.1.0 http://predictionio.apache.org

Apache PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction

19/03 2018

dev-develop

dev-develop http://predictionio.apache.org

Apache PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

26/04 2016

v0.9.0

0.9.0.0 http://prediction.io

PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

13/12 2014

v0.8.3

0.8.3.0 http://prediction.io

PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

22/11 2014

v0.8.2

0.8.2.0 http://prediction.io

PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

23/09 2014

v0.8.0

0.8.0.0 http://prediction.io

PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

10/05 2014

v0.7.1

0.7.1.0 http://prediction.io

PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

05/02 2014

v0.6.3

0.6.3.0 http://prediction.io

PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

27/01 2014

v0.6.2

0.6.2.0 http://prediction.io

PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

04/12 2013

v0.6.1

0.6.1.0 http://prediction.io

PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

05/09 2013

v0.6.0

0.6.0.0 http://prediction.io

PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

20/07 2013

v0.5.0

0.5.0.0 http://prediction.io

PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

17/04 2013

v0.3.1

0.3.1.0 http://prediction.io

PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone

25/03 2013

v0.3

0.3.0.0 http://prediction.io

PredictionIO API PHP Client

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

rest restful web service recommendation predictionio prediction tappingstone