Recommendation Logics¶
Logic allows you to specify the desired behavior of the recommendation model.
While Recombee is generally a domain-independent recommendation engine and the default model is optimized to work well in most cases, we have used our experience in some frequent domains to setup some tuned models, and you can now easily pick the logic that is tailored for the particular case.
Setting logic in the Admin UI¶
You can assign a particular logic to a Scenario in Admin UI.

Setting Logic in the Admin UI¶
Alternatively you can use API parameter to set the logic.
List of Logics¶
There is a list logics available for most of the databases. Some databases tweaked by the Recombee support team may have custom logic.
Tip
See the Integration Tips if you are not sure which logic should be used in your use case
Universal Models¶
Universal Recombee models for the most common use-cases.
recombee:default¶
Applicable to endpoints: Recommend Items to Item, Recommend Items to User, Recommend Users to Item, Recommend Users to User, Recommend Item Segments to Item, Recommend Item Segments to User, Recommend Item Segments to Item Segment
recombee:homepage¶
Applicable to endpoints: Recommend Items to User
recombee:personal¶
Applicable to endpoints: Recommend Items to User
Requirements¶
There must be interaction data for the user.
recombee:similar¶
Applicable to endpoints: Recommend Items to Item, Recommend Users to User
recombee:popular¶
Applicable to endpoints: Recommend Items to Item, Recommend Items to User
Requirements¶
Interaction data (Detail Views/Purchases/Cart Additions) must be present.
Parameters¶
Parameter |
Type |
Default |
Description |
---|---|---|---|
|
|
|
The time period in seconds (from now to the past) in which the popularity is measured. For example, by providing value of |
|
|
|
ReQL filter on top of user properties defining the segment of users among whom the popularity is calculated. For example, when user properties like |
|
|
|
Interaction types to be taken into account when computing the popularity. By default, all the interactions are taken into account. But for example by providing only |
recombee:recently-viewed¶
Applicable to endpoints: Recommend Items to User
Requirements¶
Detail Views must exist for the user.
Parameters¶
Parameter |
Type |
Default |
Description |
---|---|---|---|
|
|
|
Maximal age of the DetailView in seconds since the current timestamp. |
|
|
|
Order in which the items are returned with regard to the time when they were interacted. When the order is descending, the last interacted item is at the beginning of the list of recommendations. When it is ascending, the first interacted item matching the |
recombee:visually-similar¶
Applicable to endpoints: Recommend Items to Item
recombee:visually-similar
, it isRequirements¶
Some image properties must be defined for items, with valid image links provided for the majority of the items in the catalog.
Parameters¶
Parameter |
Type |
Default |
Description |
---|---|---|---|
|
|
|
Enable fallback models to make the recommendations if the model based on visual similarity cannot be used (e.g. due to a missing image for the given source item). |
recombee:similar-properties¶
Applicable to endpoints: Recommend Items to Item, Recommend Users to User
recombee:similar-properties
, they areRequirements¶
Some properties must exist for the items/users, depending on the used API endpoint.
Parameters¶
Parameter |
Type |
Default |
Description |
---|---|---|---|
|
|
|
Enable fallback models to make recommendations if the model based on item properties cannot be used (e.g. due to missing property values for the given source item). |
recombee:emailing¶
Applicable to endpoints: Recommend Items to User
Parameters¶
Parameter |
Type |
Default |
Description |
---|---|---|---|
|
|
|
A policy determining how strictly should already recommended items be rotated. Default option “smart” contains fine tuned rotation settings, which take into account position of recommended items and enables some of the items to re-appear in further e-mails. Option “total” never recommends items that have already appeared in previous e-mails. |
recombee:custom-sort¶
Applicable to endpoints: Recommend Items to Item, Recommend Items to User
E-commerce¶
Models specifically tuned for E-Commerce use-cases.
ecommerce:homepage¶
Applicable to endpoints: Recommend Items to User
ecommerce:similar-products¶
Applicable to endpoints: Recommend Items to Item
ecommerce:cross-sell¶
Applicable to endpoints: Recommend Items to User, Recommend Items to Item, Recommend Users to Item
Requirements¶
Purchases must be present for the item/user.
ecommerce:bestseller¶
Applicable to endpoints: Recommend Items to Item, Recommend Items to User
Requirements¶
Purchases must be present in the database.
ecommerce:similarly-purchasing¶
Applicable to endpoints: Recommend Users to User
Requirements¶
Purchases must be present for the user.
Classified Advertising¶
Models tailored for classified advertising (real estate, automotive, electronics, services, etc.).
classifieds:homepage¶
Applicable to endpoints: Recommend Items to User
classifieds:personal¶
Applicable to endpoints: Recommend Items to User
classifieds:similar-ads¶
Applicable to endpoints: Recommend Items to Item
Search¶
Models for both personalized and non-personalized fulltext search.
search:personalized¶
Applicable to endpoints: request-recommend-search-items
Parameters¶
Parameter |
Type |
Default |
Description |
---|---|---|---|
|
|
|
Determines whether personalization or the fulltext much should have higher priority in ranking of the items. |
search:non-personalized¶
Applicable to endpoints: request-recommend-search-items, request-recommend-search-item-segments
Setting logic using API parameter¶
The logic can be set per individual recommendation request by passing its name, such as ecommerce:homepage, to the logic parameter:
client.send(new recombee.RecommendItemsToUser('user-x', 10,
{
logic: 'ecommerce:homepage'
}
), callback
);
result = client.send(RecommendItemsToUser("user-x", 10, logic="ecommerce:homepage"))
result = client.send(RecommendItemsToUser.new('user-x', 10, {:logic => 'ecommerce:homepage'}))
import com.recombee.api_client.bindings.Logic;
RecommendationResponse result = client.send(new RecommendItemsToUser("user-x", 10)
.setLogic(new Logic("ecommerce:homepage"))
);
client.send(new rqs.RecommendItemsToUser('user-x', 10, {'logic': 'ecommerce:homepage'}), callback);
<?php
$result = $client->send(new RecommendItemsToUser('user-x', 10, ['logic' => 'ecommerce:homepage']));
?>
using Recombee.ApiClient.Bindings;
RecommendationResponse result = client.Send(RecommendItemsToUser("user-x", 10,
logic: new Logic("ecommerce:homepage")
)
);
GET /my-db-id/recomms/users/user-x/items/?count=10&logic=ecommerce:homepage
Some logic can have parameters - if you specify just name, you will get some reasonable default, but you can tweak the parameters according to your particular needs:
client.send(new recombee.RecommendItemsToUser('user-x', 10,
{
logic:
{
name: 'recombee:recently-viewed',
settings: {
maxAge: 3*24*60*60
}
}
}), callback
);
result = client.send(RecommendItemsToUser("user-x", 10,
logic={"name": "recombee:recently-viewed",
"settings": {
"maxAge": 3*24*60*60
}
})
)
result = client.send(RecommendItemsToUser.new('user-x', 10,
{'logic' => {
'name' => 'recombee:recently-viewed',
'settings' => {
'maxAge' => 3*24*60*60
}
}
}))
import com.recombee.api_client.bindings.Logic;
Logic l = new Logic("recombee:recently-viewed", new HashMap<String, Object>() {
{put("maxAge", 3*24*60*60);}
});
RecommendationResponse result = client.send(new RecommendItemsToUser("user-x", 10)
.setLogic(l));
client.send(new rqs.RecommendItemsToUser('user-x', 10,
{'logic':
{
'name': 'recombee:recently-viewed',
'settings': {
'maxAge': 3*24*60*60
}
}
}))
.then((recomms) => {
console.log(recomms);
});
<?php
$result = $client->send(new RecommendItemsToUser('user-x', 10,
['logic' => [
'name' => 'recombee:recently-viewed',
'settings' => [
'maxAge' => 3*24*60*60
]
]
]));
?>
using Recombee.ApiClient.Bindings;
Logic l = new Logic("recombee:recently-viewed",
new Dictionary<string, object>() {
{"maxAge", 3*24*60*60}
}
);
var recommendationResponse = client.Send(new RecommendItemsToUser("user-x", 5, logic: l));
POST /my-db-id/recomms/users/user-x/items/
Body:
{
"count": 10,
"logic": {
"name": "recombee:recently-viewed",
"settings":{
"maxAge": 259200
}
}
}