predictionio-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cody Kimball <cody-kimb...@pluralsight.com>
Subject PredictionIO return array of objects
Date Fri, 16 Jun 2017 16:50:22 GMT
Architectural Design Question:

I have a model that performs as expected and returns an array of ID's with
their associated scores. Now as I am trying to get the PIO response to
render their associated pieces of content on our website, it looks like I
will need not only those IDs but other meta tag values as well to render
the pieces of content on the website properly.

My question is can the PredictionIO response array of objects be easily
configured to return the TargetEntityID and score, as exists currently, as
well as with a few specific items it pulls from the property list?

example:

{
  "itemScores":[
    {"item":"22","score":4.072304374729956, "title":"title1",
"description":"helpful meta description1", "image":"imageurl1"},
    {"item":"62","score":4.058482414005789, "title":"title2",
"description":"helpful meta description2", "image":"imageurl2"},
    {"item":"75","score":4.046063009943821, "title":"title3",
"description":"helpful meta description3", "image":"imageurl3"},
    {"item":"68","score":3.8153661512945325, "title":"title4",
"description":"helpful meta description4", "image":"imageurl4"}
  ]
}

Or would it make more sense to have the input value for TargetEntityID be a
json object for PredictionIO to train on, possibly by altering the training
model to only use the "ID" attribute from that object to train on?

itemScores":[
    {"item": {"ID": "22", "title":"title1", "description":"helpful meta
description1", "image":"imageurl1},"score":4.072304374729956},

Or even I could fudge the model to have targetEntityID be a large
concatenated value, which in my mind seems like problems waiting to happen.

itemScores":[
    {"item": "22 || title1 || helpful meta description1 || imageurl1"}
,"score":4.072304374729956},

-- 
*Cody Kimball*
Revenue Engineer

 Don't Just Keep Up With Technology. Master It!
<https://www.pluralsight.com/>

Mime
View raw message