2017 © Pedro Peláez
 

library laravel-5-predictionio

Laravel 5 wrapper for PredictionIO v0.9.*

image

linkthrow/laravel-5-predictionio

Laravel 5 wrapper for PredictionIO v0.9.*

  • Friday, July 29, 2016
  • by linkthrow
  • Repository
  • 1 Watchers
  • 2 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Laravel PredictionIO

*Based on michaeljhopkins, (*1)

The Laravel PredictionIO 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., (*2)

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., (*3)

Installation

  • Install library and dependencies:
$ composer require "linkthrow/laravel-5-predictionio"
  • Add a provider in app/config/app.php:
    LinkThrow\LaravelPredictionIO\Provider\PredictionIOServiceProvider::class
  • Add an alias in app/config/app.php:
    'EngineClient'      => LinkThrow\LaravelPredictionIO\Facades\EngineFacade::class,
        'EventClient'       => LinkThrow\LaravelPredictionIO\Facades\EventFacade::class,
    'predictionio' => [
        'key' => '0250b3f85ce33284f77c77f36b41010ef2c4fc5c',
        'url' => 'http://localhost:7200'
    ],

Set a User Record from Your App

// assume you have a user with user ID 5
$response = EventClient::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 = EventClient::setItem('bookId1', array('itypes' => 1));

Import a User Action (View) form Your App

// assume this user has viewed this book item
EventClient::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)

$response = EngineClient::sendQuery(array('uid'=>7, 'iids'=>array(1,2,3,4,5)));

print_r($response);

License

This project is licensed using DBAD. Go have a blast., (*4)

The Versions

29/07 2016

dev-master

9999999-dev

Laravel 5 wrapper for PredictionIO v0.9.*

  Sources   Download

MIT

The Requires

 

laravel api wrapper machine learning predictionio