public class RecommendItemsToUser extends Request
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
booster
Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some items based on the values of their attributes.
|
protected java.lang.Boolean |
cascadeCreate
If the user does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database.
|
protected java.lang.Long |
count
Number of items to be recommended (N for the top-N recommendation).
|
protected java.lang.Double |
diversity
**Expert option** Real number from [0.0, 1.0] which determines how much mutually dissimilar should the recommended items be.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
expertSettings
Dictionary of custom options.
|
protected java.lang.String |
filter
Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended items based on the values of their attributes.
|
protected java.lang.String[] |
includedProperties
Allows to specify, which properties should be returned when `returnProperties=true` is set.
|
protected Logic |
logic
Logic specifies particular behavior of the recommendation models.
|
protected java.lang.String |
minRelevance
**Expert option** Specifies the threshold of how much relevant must the recommended items be to the user.
|
protected java.lang.Boolean |
returnAbGroup
If there is a custom AB-testing running, return name of group to which the request belongs.
|
protected java.lang.Boolean |
returnProperties
With `returnProperties=true`, property values of the recommended items are returned along with their IDs in a JSON dictionary.
|
protected java.lang.Double |
rotationRate
**Expert option** If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times.
|
protected java.lang.Double |
rotationTime
**Expert option** Taking *rotationRate* into account, specifies how long time it takes to an item to recover from the penalization.
|
protected java.lang.String |
scenario
Scenario defines a particular application of recommendations.
|
protected java.lang.String |
userId
ID of the user for whom personalized recommendations are to be generated.
|
Constructor and Description |
---|
RecommendItemsToUser(java.lang.String userId,
long count)
Construct the request
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getBodyParameters()
Get body parameters
|
java.lang.String |
getBooster() |
boolean |
getCascadeCreate() |
long |
getCount() |
double |
getDiversity() |
java.util.Map<java.lang.String,java.lang.Object> |
getExpertSettings() |
java.lang.String |
getFilter() |
HTTPMethod |
getHTTPMethod() |
java.lang.String[] |
getIncludedProperties() |
Logic |
getLogic() |
java.lang.String |
getMinRelevance() |
java.lang.String |
getPath() |
java.util.Map<java.lang.String,java.lang.Object> |
getQueryParameters()
Get query parameters
|
boolean |
getReturnAbGroup() |
boolean |
getReturnProperties() |
double |
getRotationRate() |
double |
getRotationTime() |
java.lang.String |
getScenario() |
java.lang.String |
getUserId() |
RecommendItemsToUser |
setBooster(java.lang.String booster) |
RecommendItemsToUser |
setCascadeCreate(boolean cascadeCreate) |
RecommendItemsToUser |
setDiversity(double diversity) |
RecommendItemsToUser |
setExpertSettings(java.util.Map<java.lang.String,java.lang.Object> expertSettings) |
RecommendItemsToUser |
setFilter(java.lang.String filter) |
RecommendItemsToUser |
setIncludedProperties(java.lang.String[] includedProperties) |
RecommendItemsToUser |
setLogic(Logic logic) |
RecommendItemsToUser |
setMinRelevance(java.lang.String minRelevance) |
RecommendItemsToUser |
setReturnAbGroup(boolean returnAbGroup) |
RecommendItemsToUser |
setReturnProperties(boolean returnProperties) |
RecommendItemsToUser |
setRotationRate(double rotationRate) |
RecommendItemsToUser |
setRotationTime(double rotationTime) |
RecommendItemsToUser |
setScenario(java.lang.String scenario) |
getEnsureHttps, getTimeout, setTimeout
protected java.lang.String userId
protected java.lang.Long count
protected java.lang.String scenario
protected java.lang.Boolean cascadeCreate
protected java.lang.Boolean returnProperties
protected java.lang.String[] includedProperties
protected java.lang.String filter
protected java.lang.String booster
protected Logic logic
protected java.lang.Double diversity
protected java.lang.String minRelevance
protected java.lang.Double rotationRate
protected java.lang.Double rotationTime
protected java.util.Map<java.lang.String,java.lang.Object> expertSettings
protected java.lang.Boolean returnAbGroup
public RecommendItemsToUser(java.lang.String userId, long count)
userId
- ID of the user for whom personalized recommendations are to be generated.count
- Number of items to be recommended (N for the top-N recommendation).public RecommendItemsToUser setScenario(java.lang.String scenario)
scenario
- Scenario defines a particular application of recommendations. It can be for example "homepage", "cart" or "emailing".
You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see performance of each scenario in the Admin UI separately, so you can check how well each application performs.
The AI which optimizes models in order to get the best results may optimize different scenarios separately, or even use different models in each of the scenarios.public RecommendItemsToUser setCascadeCreate(boolean cascadeCreate)
cascadeCreate
- If the user does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database. This allows for example rotations in the following recommendations for that user, as the user will be already known to the system.public RecommendItemsToUser setReturnProperties(boolean returnProperties)
returnProperties
- With `returnProperties=true`, property values of the recommended items are returned along with their IDs in a JSON dictionary. The acquired property values can be used for easy displaying of the recommended items to the user.
Example response:
```
{
"recommId": "ce52ada4-e4d9-4885-943c-407db2dee837",
"recomms":
[
{
"id": "tv-178",
"values": {
"description": "4K TV with 3D feature",
"categories": ["Electronics", "Televisions"],
"price": 342,
"url": "myshop.com/tv-178"
}
},
{
"id": "mixer-42",
"values": {
"description": "Stainless Steel Mixer",
"categories": ["Home & Kitchen"],
"price": 39,
"url": "myshop.com/mixer-42"
}
}
],
"numberNextRecommsCalls": 0
}
```public RecommendItemsToUser setIncludedProperties(java.lang.String[] includedProperties)
includedProperties
- Allows to specify, which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
Example response for `includedProperties=description,price`:
```
{
"recommId": "a86ee8d5-cd8e-46d1-886c-8b3771d0520b",
"recomms":
[
{
"id": "tv-178",
"values": {
"description": "4K TV with 3D feature",
"price": 342
}
},
{
"id": "mixer-42",
"values": {
"description": "Stainless Steel Mixer",
"price": 39
}
}
],
"numberNextRecommsCalls": 0
}
```public RecommendItemsToUser setFilter(java.lang.String filter)
filter
- Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended items based on the values of their attributes.
Filters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).public RecommendItemsToUser setBooster(java.lang.String booster)
booster
- Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some items based on the values of their attributes.
Boosters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).public RecommendItemsToUser setLogic(Logic logic)
logic
- Logic specifies particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
See [this section](https://docs.recombee.com/recommendation_logics.html) for list of available logics and other details.
The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
Logic can be also set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).public RecommendItemsToUser setDiversity(double diversity)
diversity
- **Expert option** Real number from [0.0, 1.0] which determines how much mutually dissimilar should the recommended items be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.public RecommendItemsToUser setMinRelevance(java.lang.String minRelevance)
minRelevance
- **Expert option** Specifies the threshold of how much relevant must the recommended items be to the user. Possible values one of: "low", "medium", "high". The default value is "low", meaning that the system attempts to recommend number of items equal to *count* at any cost. If there are not enough data (such as interactions or item properties), this may even lead to bestseller-based recommendations to be appended to reach the full *count*. This behavior may be suppressed by using "medium" or "high" values. In such case, the system only recommends items of at least the requested relevance, and may return less than *count* items when there is not enough data to fulfill it.public RecommendItemsToUser setRotationRate(double rotationRate)
rotationRate
- **Expert option** If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per-request in backward fashion. You may penalize an item for being recommended in the near past. For the specific user, `rotationRate=1` means maximal rotation, `rotationRate=0` means absolutely no rotation. You may also use, for example `rotationRate=0.2` for only slight rotation of recommended items. Default: `0`.public RecommendItemsToUser setRotationTime(double rotationTime)
rotationTime
- **Expert option** Taking *rotationRate* into account, specifies how long time it takes to an item to recover from the penalization. For example, `rotationTime=7200.0` means that items recommended less than 2 hours ago are penalized. Default: `7200.0`.public RecommendItemsToUser setExpertSettings(java.util.Map<java.lang.String,java.lang.Object> expertSettings)
expertSettings
- Dictionary of custom options.public RecommendItemsToUser setReturnAbGroup(boolean returnAbGroup)
returnAbGroup
- If there is a custom AB-testing running, return name of group to which the request belongs.public java.lang.String getUserId()
public long getCount()
public java.lang.String getScenario()
public boolean getCascadeCreate()
public boolean getReturnProperties()
public java.lang.String[] getIncludedProperties()
public java.lang.String getFilter()
public java.lang.String getBooster()
public Logic getLogic()
public double getDiversity()
public java.lang.String getMinRelevance()
public double getRotationRate()
public double getRotationTime()
public java.util.Map<java.lang.String,java.lang.Object> getExpertSettings()
public boolean getReturnAbGroup()
public HTTPMethod getHTTPMethod()
getHTTPMethod
in class Request
public java.lang.String getPath()
public java.util.Map<java.lang.String,java.lang.Object> getQueryParameters()
getQueryParameters
in class Request
public java.util.Map<java.lang.String,java.lang.Object> getBodyParameters()
getBodyParameters
in class Request