2017 © Pedro Peláez
 

library prediction-io

Endroid PredictionIo Client

image

endroid/prediction-io

Endroid PredictionIo Client

  • Monday, April 16, 2018
  • by endroid
  • Repository
  • 1 Watchers
  • 17 Stars
  • 3,233 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 34 Versions
  • 0 % Grown

The README.md

Prediction IO

By endroid, (*1)

Build Status Latest Stable Version Total Downloads License, (*2)

The Prediction IO library provides a client which offers easy access to a PredictionIo recommendation engine. PredictionIo is an open source machine learning server for software developers to create predictive features, such as personalization, recommendation and content discovery., (*3)

Through a small set of simple calls, all server functionality is exposed to your application. You can add users and items, register actions between these users and items and retrieve recommendations deduced from this information by any PredictionIo recommendation engine. Applications range from showing recommended products in a web shop to discovering relevant experts in a social collaboration network., (*4)

Recommendations, (*5)

Requirements

Installation

Use Composer to install the library., (*6)

``` bash $ composer require endroid/prediction-io, (*7)


## Usage ```php use Endroid\PredictionIo\EventClient; use Endroid\PredictionIo\EngineClient; $apiKey = '...'; $eventClient = new EventClient($apiKey); $recommendationEngineClient = new EngineClient('http://localhost:8000'); $similarProductEngineClient = new EngineClient('http://localhost:8001'); // Populate with users and items $userProperties = ['address' => '1234 Street, San Francisco, CA 94107', 'birthday' => '22-04-1991']; $eventClient->createUser('user_1', $userProperties); $itemProperties = ['categories' => [123, 1234, 12345]]; $eventClient->createItem('product_1', $itemProperties); // Record actions $actionProperties = ['firstView' => true]; $eventClient->recordUserActionOnItem('view', 'user_1', 'product_1', $actionProperties); // Return recommendations $itemCount = 20; $recommendedProducts = $recommendationEngineClient->getRecommendedItems('user_1', $itemCount); $similarProducts = $similarProductEngineClient->getSimilarItems('product_1', $itemCount);

Symfony integration

Register the Symfony bundle in the kernel., (*8)

// app/AppKernel.php

public function registerBundles()
{
    $bundles = [
        // ...
        new Endroid\PredictionIo\Bundle\PredictionIoBundle\EndroidPredictionIoBundle(),
    ];
}

The default parameters can be overridden via the configuration., (*9)

endroid_prediction_io:
    event_server:
        url: http://localhost:7070
    apps:
        app_one:
            key: '...'
            engines:
                recommendation:
                    url: http://localhost:8000
                similarproduct:
                    url: http://localhost:8001
                viewedthenbought:
                    url: http://localhost:8002
                complementarypurchase:
                    url: http://localhost:8003
                productranking:
                    url: http://localhost:8004
                leadscoring:
                    url: http://localhost:8005
        app_two:
            key: '...'
            engines:
                complementarypurchase:
                    url: http://localhost:8006
                leadscoring:
                    url: http://localhost:8007

Now you can retrieve the event and engine clients as follows., (*10)

/** @var EventClient $eventClient */
$eventClient = $this->get('endroid.prediction_io.app_one.event_client');

/** @var EngineClient $recommendationEngineClient */
$recommendationEngineClient = $this->get('endroid.prediction_io.app_one.recommendation.engine_client');

/** @var EngineClient $similarProductEngineClient */
$similarProductEngineCl![Recommendations](https://raw.githubusercontent.com/endroid/PredictionIo/master/assets/recommendations.png)ient = $this->get('endroid.prediction_io.app_one.similarproduct.engine_client');

Docker

Many Docker images exist for running a PredictionIo server. Personally I used the spereio image to create an image that creates, trains and deploys a recommendation engine and starts the PIO server. It starts a cron that trains the model every 5 minutes. You can find that image here., (*11)

Vagrant box

PredictionIo provides a Vagrant box containing an out-of-the-box PredictionIo server., (*12)

Versioning

Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatible changes will be kept to a minimum but be aware that these can occur. Lock your dependencies for production and test your code when upgrading., (*13)

License

This bundle is under the MIT license. For the full copyright and license information please view the LICENSE file that was distributed with this source code., (*14)

The Versions

16/04 2018

dev-master

9999999-dev https://github.com/endroid/prediction-io

Endroid PredictionIo Client

  Sources   Download

MIT

The Requires

 

The Development Requires

php bundle symfony endroid io predictionio prediction

04/03 2018

3.0.0

3.0.0.0 https://github.com/endroid/prediction-io

Endroid PredictionIo Client

  Sources   Download

MIT

The Requires

 

The Development Requires

php endroid io predictionio prediction

31/12 2017

2.x-dev

2.9999999.9999999.9999999-dev https://github.com/endroid/prediction-io

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

15/09 2017

2.3.2

2.3.2.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

07/09 2017

2.3.1

2.3.1.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

07/09 2017

2.2.8

2.2.8.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

29/06 2017

2.2.7

2.2.7.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

29/06 2017

2.2.6

2.2.6.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

29/06 2017

2.2.5

2.2.5.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

29/06 2017

2.2.4

2.2.4.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

27/06 2017

2.2.3

2.2.3.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

14/06 2017

2.2.2

2.2.2.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

17/05 2017

2.2.1

2.2.1.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

13/05 2017

2.2.0

2.2.0.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

01/01 2017

2.1.2

2.1.2.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

31/12 2016

2.1.1

2.1.1.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

31/12 2016

2.1.0

2.1.0.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid io predictionio prediction

08/11 2016

2.0.8

2.0.8.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

11/10 2016

2.0.7

2.0.7.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

02/10 2016

2.0.6

2.0.6.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

24/04 2016

2.0.5

2.0.5.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

02/01 2016

2.0.4

2.0.4.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

04/07 2015

2.0.3

2.0.3.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

endroid io predictionio prediction

04/07 2015

2.0.2

2.0.2.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

endroid io predictionio prediction

25/06 2015

2.0.1

2.0.1.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

The Development Requires

endroid io predictionio prediction

01/06 2015

2.0.0

2.0.0.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

26/05 2015

1.0.6

1.0.6.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

26/05 2015

1.0.5

1.0.5.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

12/04 2015

1.0.4

1.0.4.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

26/01 2015

dev-develop

dev-develop https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

18/12 2013

1.0.3

1.0.3.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

24/10 2013

1.0.2

1.0.2.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

22/10 2013

1.0.1

1.0.1.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction

22/10 2013

1.0.0

1.0.0.0 https://github.com/endroid/PredictionIO

Endroid PredictionIO Client

  Sources   Download

MIT

The Requires

 

endroid io predictionio prediction