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

Eab0f0d42556979629d191ef6c471b5d?s=128

Florian Eckerstorfer

September 08, 2014
Tweet

Transcript

  1. 1.
  2. 7.

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

    and study of systems that can learn from data. wikipedia.org/wiki/Machine_learning
  3. 9.

    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 ?
  4. 10.

    S S S S S S S S S S

    S S S S S S S S 1. Training
  5. 14.

    kNN

  6. 15.
  7. 22.

    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 Ω Ω
  8. 25.

    use PredictionIO\PredictionIOClient; $client = PredictionIOClient::factory(array('appkey'=> '…')); ! // Create a

    user $command = $client->getCommand( 'create_user', ['pio_uid' => 'florian'] ); $response = $client->execute($command);
  9. 26.

    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);
  10. 27.

    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);
  11. 28.

    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);
  12. 29.