public class RecommendUsersToUser 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 users 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 users 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 users be.
|
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 users 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 user to recover from the penalization.
|
protected java.lang.String |
scenario
Scenario defines a particular application of recommendations.
|
protected java.lang.String |
userId
User to whom we find similar users
|
Constructor and Description |
---|
RecommendUsersToUser(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() |
RecommendUsersToUser |
setBooster(java.lang.String booster) |
RecommendUsersToUser |
setCascadeCreate(boolean cascadeCreate) |
RecommendUsersToUser |
setDiversity(double diversity) |
RecommendUsersToUser |
setExpertSettings(java.util.Map<java.lang.String,java.lang.Object> expertSettings) |
RecommendUsersToUser |
setFilter(java.lang.String filter) |
RecommendUsersToUser |
setIncludedProperties(java.lang.String[] includedProperties) |
RecommendUsersToUser |
setLogic(Logic logic) |
RecommendUsersToUser |
setMinRelevance(java.lang.String minRelevance) |
RecommendUsersToUser |
setReturnAbGroup(boolean returnAbGroup) |
RecommendUsersToUser |
setReturnProperties(boolean returnProperties) |
RecommendUsersToUser |
setRotationRate(double rotationRate) |
RecommendUsersToUser |
setRotationTime(double rotationTime) |
RecommendUsersToUser |
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 RecommendUsersToUser(java.lang.String userId, long count)
userId
- User to whom we find similar userscount
- Number of users to be recommended (N for the top-N recommendation).public RecommendUsersToUser 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 RecommendUsersToUser 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 RecommendUsersToUser setReturnProperties(boolean returnProperties)
returnProperties
- With `returnProperties=true`, property values of the recommended users are returned along with their IDs in a JSON dictionary. The acquired property values can be used for easy displaying the recommended users.
Example response:
```
{
"recommId": "9cb9c55d-50ba-4478-84fd-ab456136156e",
"recomms":
[
{
"id": "user-17",
"values": {
"country": "US",
"sex": "F"
}
},
{
"id": "user-2",
"values": {
"country": "CAN",
"sex": "M"
}
}
],
"numberNextRecommsCalls": 0
}
```public RecommendUsersToUser 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=country`:
```
{
"recommId": "b326d82d-5d57-4b45-b362-c9d6f0895855",
"recomms":
[
{
"id": "user-17",
"values": {
"country": "US"
}
},
{
"id": "user-2",
"values": {
"country": "CAN"
}
}
],
"numberNextRecommsCalls": 0
}
```public RecommendUsersToUser 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 RecommendUsersToUser 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 RecommendUsersToUser 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 RecommendUsersToUser setDiversity(double diversity)
diversity
- **Expert option** Real number from [0.0, 1.0] which determines how much mutually dissimilar should the recommended users be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.public RecommendUsersToUser setMinRelevance(java.lang.String minRelevance)
minRelevance
- **Expert option** Specifies the threshold of how much relevant must the recommended users be. Possible values one of: "low", "medium", "high".public RecommendUsersToUser 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 user 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 users.public RecommendUsersToUser setRotationTime(double rotationTime)
rotationTime
- **Expert option** Taking *rotationRate* into account, specifies how long time it takes to an user to recover from the penalization. For example, `rotationTime=7200.0` means that users recommended less than 2 hours ago are penalized.public RecommendUsersToUser setExpertSettings(java.util.Map<java.lang.String,java.lang.Object> expertSettings)
expertSettings
- Dictionary of custom options.public RecommendUsersToUser 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