Recommendation Logics

The logic parameter of recommendation endpoints 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.

How to set the logic

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
        }
  }
}

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.


Universal Models

Set of universal Recombee models for the most common use-cases.

recombee:default

recombee:default

Applicable to endpoints: Recommend items to item, Recommend items to user, Recommend users to item, Recommend users to user

Default model ensemble aiming to work well in most common use-cases. It is an ensemble of collaborative filtering and content-based recommendation, backed by popularity-based models when there’s not enough data in given context.
The ensemble is being continuously optimized by AI so it automatically adapts to incoming data.

recombee:homepage

recombee:homepage

Applicable to endpoints: Recommend items to user

Universal model ensemble suitable for putting recommendations on the homepage / welcome-screen scenarios.

recombee:personal

recombee:personal

Applicable to endpoints: Recommend items to user

Universal model ensemble suitable for user-based recommendations reflecting the personal tastes of the current user.
Requirements
  • There must be interaction data for the user.

recombee:similar

recombee:similar

Applicable to endpoints: Recommend items to item, Recommend users to user

Universal model ensemble suitable for either recommending items which are similar to the given item (in case of Items-to-Item recommendation), or recommending users who are similar to the given user (in case of Users-to-User recommendation).

recombee:recently-viewed

recombee:recently-viewed

Applicable to endpoints: Recommend items to user

Model returning for particular user the list of recently viewed items.
Requirements
  • Detail Views must exist for the user.
Parameters
Parameter Type Default Description
maxAge double 1209600 Maximal age of the DetailView in seconds since the current timestamp.
recencyOrdering enum descending 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 maxAge condition is at the beginning of the list.

E-commerce

Set of models specifically tuned for E-Commerce use-cases.

ecommerce:homepage

ecommerce:homepage

Applicable to endpoints: Recommend items to user

Model ensemble suitable for recommending products on homepage/welcome page in E-Commerce and online retail systems.

ecommerce:similar-products

ecommerce:similar-products

Applicable to endpoints: Recommend items to item

Model ensemble suitable for recommending similar products (alternatives) to a source (currently viewed) product.

ecommerce:cross-sell

ecommerce:cross-sell

Applicable to endpoints: Recommend items to user, Recommend items to item, Recommend users to item

Model ensemble suitable for recommending compatible/complementary products. In user-based case, the products are compatible with those that the user has already purchased. In item-based case, they are compatible with the source (currently viewed) item.
Requirements
  • Purchases must be present for the item/user.

ecommerce:bestseller

ecommerce:bestseller

Applicable to endpoints: Recommend items to item, Recommend items to user

Model suitable for recommending globally most purchased items.
Requirements
  • Purchases must be present in the database.

ecommerce:similarly-purchasing

ecommerce:similarly-purchasing

Applicable to endpoints: Recommend users to user

Recommends users with similar purchasing behaviour as the source user.
Requirements
  • Purchases must be present for the user.

Classified Advertising

Set of models tailored for classified advertising (real estate, automotive, electronics, services, etc.)

classifieds:homepage

classifieds:homepage

Applicable to endpoints: Recommend items to user

Model ensemble suitable for recommending products on homepage/welcome page of a Classified advertising site.

classifieds:personal

classifieds:personal

Applicable to endpoints: Recommend items to user

Model ensemble suitable for recommending picked ads right for the given user. Can be used on different places, such as in-category recommendation when augmented with appropriate ReQL filter.

classifieds:similar-ads

classifieds:similar-ads

Applicable to endpoints: Recommend items to item

Model ensemble suitable for recommending ads that are similar to the one which is currently viewed.