Need Help?

Prediction

Last Updated: Dec 10, 2015
The "predict" field of documents is used for training predictors on documents. For example, your documents might be reviews of restaurants, written by people who also gave numerical ratings; if you put the ratings in the "predict" field, Luminoso can learn what reviews correspond to what numerical ratings, and if you give it new reviews without ratings, it can predict what the ratings would be.

The standard format for the predict field maps variable names to values, such as:

    {"rating": 3.2}

You can alternatively specify just a number (e.g. 3.2), but in that case Luminoso doesn't know what the number represents so it can't give it a nice name like "rating", and will call it "predict_variable": 

     {"predict_variable": 3.2}

You can even specify multiple variables to predict - for example, if each of your restaurant reviews contains ratings for multiple aspects of the restaurant:

    {"food quality": 3.2,
   "expensiveness": 5}


The values of the variables don't have to be numbers, they can also be strings. If they're numbers, then the predictor will predict numerical values when you ask it for predictions on new documents - for example, if you have two documents and their ratings are 1 and 2, the predictor might give a new review a predicted rating of 1.6. If the values are strings, the predictor will use those strings as predicted values for new documents - for example, if you have two documents and their ratings are "$" and "$$$", then the predictor might give a new review a predicted rating of either "$" or "$$$", but it can't predict "$$".

You may also specify the predict field in either of two deprecated formats (and documents retrieved through the API from old projects may have predict fields using the second of these):

    {"rating": {"value": 3.2}}
    {"rating": {"value": 3.2, "weight": 1.0}}
 
We no longer use the "weight" field; uploading it as anything other than 1 will result in a warning.

More Support

6560c840000970c2e652c21ccafb3167@luminoso.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete