Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Machine Learning with PredictionIO and PHP

Machine Learning with PredictionIO and PHP

Slides from my presentation at ViennaPHP on 8 September 2014 on Machine Learning with PredictionIO and PHP.

The code example is available on Github: https://github.com/florianeckerstorfer/viennaphp-predictionio

Florian Eckerstorfer

September 08, 2014
Tweet

More Decks by Florian Eckerstorfer

Other Decks in Programming

Transcript

  1. Machine learning, a branch of artificial intelligence, concerns the construction

    and study of systems that can learn from data. wikipedia.org/wiki/Machine_learning
  2. Name Creator Network Episode Length Genre The Sopranos David Chase

    HBO 60 Drama Weeds Jenji Kohan Showtime 30 Comedy Girls Lena Dunham HBO 30 Comedy Orange Is The New Black Jenji Koahn Netflix 30 ?
  3. S S S S S S S S S S

    S S S S S S S S 1. Training
  4. kNN

  5. PredictionIO Server Admin Web UI Admin Server Engine A Engine

    B Algorithm X Algorithm Y Algorithm S Algorithm T Workflow Scheduler MapReduce Engine Hadoop Distributed File System Predictive Model Storage Databases REST API Servers SDK SDK Web App Mobile App Ω Ω
  6. use PredictionIO\PredictionIOClient; $client = PredictionIOClient::factory(array('appkey'=> '…')); ! // Create a

    user $command = $client->getCommand( 'create_user', ['pio_uid' => 'florian'] ); $response = $client->execute($command);
  7. use PredictionIO\PredictionIOClient; $client = PredictionIOClient::factory(array('appkey'=> '…')); ! // Create an

    item $command = $client->getCommand( 'create_item', ['pio_iid' => 'Game of Thrones', 'pio_itypes' => 1] ); $response = $client->execute($command);
  8. use PredictionIO\PredictionIOClient; $client = PredictionIOClient::factory(array('appkey'=> '…')); ! // User likes

    an item $client->identify('florian'); $command = $client->getCommand( 'record_action_on_item', ['pio_action' => 'like', 'pio_iid' => 'Game of Thrones'] ); $client->execute($command);
  9. use PredictionIO\PredictionIOClient; $client = PredictionIOClient::factory(array('appkey'=> '…')); ! // Top N

    recommendations for user $client->identify('florian'); $command = $client->getCommand( 'itemrec_get_top_n', ['pio_engine' => 'engine1', 'pio_n' => 10] ); $rec = $client->execute($command); print_r($rec);