Hound Query Language
Factors
Factors are how you drive recommendations and personalization.
factors
are constructed inside a JSON payload and passed as the POST body. factors
are accepted by the Relate endpoint.
Overview
A factor is an ID of a User or any piece of entertainment content, such as a Movie, Trait, Contributor, etc. The recommendations we provide will be based upon these Factors. The recommendation engine will take into account every factor you provide. For instance, to get personalized recommendations for a User, you would add that User's MHID as a factor in your request, like so:
{"factors": [{"id": "mhusrpmhq3oQGJPxTtuCAVnRA9dirg6vXulOB1SGpJcX","weight": WEIGHT_OBJECT (see below),"boostOnly": BOOST_ONLY_OBJECT (see below)}]}
Property Summary
Property | Description |
---|---|
id | A String representing the User's MHID. |
weight | A float... |
boostOnly | A boolean... |
How it fits into the rest of the Hound Query Language
As stated at the top of the page, factors
is accepted by the Relate endpoint. Below is a sample layout of the JSON as it would be sent to that endpoint, as the query parameter params
.
Relate
When used in a Relate call, you might also utilize filters
and components
to filter the results, and to control what metadata you get back, respectively.
This would be laid out like so:
{"factors": FACTORS_ARRAY,"filters": FILTERS_OBJECT,"components": COMPONENTS_ARRAY}
Weight
Weight is useful when you are specifying more than one factor. Let's say you want to get recommendations based on two input movies, except you want one movie to be twice as influential as the other. You would use weight
to change the influence of a factor. In this example, you would double the weight of the more influential movie:
{"factors": [{"id": "mhusr-db","weight": 2.0},{"id": "mhmov-gladiator","weight": 1.0}]}
A factor's weight is 1.0 by default.
BoostOnly
boostOnly
is similar to weight
, in that it adjusts how one factor changes results among a set of factors, but its behavior is a little different. boostOnly
is false
by default. Conceptually, when you pass in two or more Factors with boostOnly
: false
, our recommendation engine tries to intelligently find results that balance elements of each of the input Factors. The results will represent a blend of each factor as we understand it. Conversely, by marking a factor as boostOnly
: true
, you are asking our engine to blend the elements of all the other Factors into results, and then order them by the boostOnly
factor. In more concrete terms, if you provided us with three Factors; the Action trait, the Adventure Trait, and a User with boostOnly
: true
, we would show you results that were similar to Action and Adventure, but were ordered optimally for the User. Here's the corresponding request for that example:
{"factors": [{"id": "mhusr-db","boostOnly": true},{"id": "mhsgn-action"},{"id": "mhsgn-adventure"}]}