recombee_api_client 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/recombee_api_client/api/add_bookmark.rb +2 -2
- data/lib/recombee_api_client/api/add_cart_addition.rb +4 -4
- data/lib/recombee_api_client/api/add_detail_view.rb +2 -2
- data/lib/recombee_api_client/api/add_item.rb +3 -3
- data/lib/recombee_api_client/api/add_item_property.rb +2 -2
- data/lib/recombee_api_client/api/add_manual_reql_segment.rb +69 -0
- data/lib/recombee_api_client/api/add_purchase.rb +5 -5
- data/lib/recombee_api_client/api/add_rating.rb +2 -2
- data/lib/recombee_api_client/api/add_series.rb +14 -4
- data/lib/recombee_api_client/api/add_user.rb +1 -1
- data/lib/recombee_api_client/api/add_user_property.rb +2 -2
- data/lib/recombee_api_client/api/create_auto_reql_segmentation.rb +75 -0
- data/lib/recombee_api_client/api/create_manual_reql_segmentation.rb +71 -0
- data/lib/recombee_api_client/api/create_property_based_segmentation.rb +76 -0
- data/lib/recombee_api_client/api/delete_bookmark.rb +4 -4
- data/lib/recombee_api_client/api/delete_cart_addition.rb +4 -4
- data/lib/recombee_api_client/api/delete_detail_view.rb +4 -4
- data/lib/recombee_api_client/api/delete_item.rb +3 -3
- data/lib/recombee_api_client/api/{list_groups.rb → delete_manual_reql_segment.rb} +13 -7
- data/lib/recombee_api_client/api/delete_more_items.rb +4 -4
- data/lib/recombee_api_client/api/delete_purchase.rb +4 -4
- data/lib/recombee_api_client/api/delete_rating.rb +3 -3
- data/lib/recombee_api_client/api/delete_search_synonym.rb +1 -1
- data/lib/recombee_api_client/api/{add_group.rb → delete_segmentation.rb} +10 -9
- data/lib/recombee_api_client/api/delete_series.rb +14 -4
- data/lib/recombee_api_client/api/delete_user.rb +2 -2
- data/lib/recombee_api_client/api/delete_user_property.rb +1 -1
- data/lib/recombee_api_client/api/delete_view_portion.rb +1 -1
- data/lib/recombee_api_client/api/get_item_property_info.rb +1 -1
- data/lib/recombee_api_client/api/get_item_values.rb +3 -3
- data/lib/recombee_api_client/api/{list_group_items.rb → get_segmentation.rb} +9 -8
- data/lib/recombee_api_client/api/get_user_values.rb +3 -3
- data/lib/recombee_api_client/api/insert_to_series.rb +3 -3
- data/lib/recombee_api_client/api/list_item_bookmarks.rb +2 -2
- data/lib/recombee_api_client/api/list_item_cart_additions.rb +2 -2
- data/lib/recombee_api_client/api/list_item_detail_views.rb +2 -2
- data/lib/recombee_api_client/api/list_item_purchases.rb +2 -2
- data/lib/recombee_api_client/api/list_item_ratings.rb +2 -2
- data/lib/recombee_api_client/api/list_item_view_portions.rb +2 -2
- data/lib/recombee_api_client/api/list_items.rb +1 -1
- data/lib/recombee_api_client/api/{delete_group.rb → list_segmentations.rb} +10 -11
- data/lib/recombee_api_client/api/list_series_items.rb +2 -2
- data/lib/recombee_api_client/api/list_user_bookmarks.rb +1 -1
- data/lib/recombee_api_client/api/list_user_cart_additions.rb +1 -1
- data/lib/recombee_api_client/api/list_user_detail_views.rb +1 -1
- data/lib/recombee_api_client/api/list_user_purchases.rb +1 -1
- data/lib/recombee_api_client/api/list_user_ratings.rb +1 -1
- data/lib/recombee_api_client/api/list_user_view_portions.rb +1 -1
- data/lib/recombee_api_client/api/list_users.rb +1 -1
- data/lib/recombee_api_client/api/merge_users.rb +2 -2
- data/lib/recombee_api_client/api/recommend_item_segments_to_item.rb +131 -0
- data/lib/recombee_api_client/api/recommend_item_segments_to_item_segment.rb +131 -0
- data/lib/recombee_api_client/api/recommend_item_segments_to_user.rb +111 -0
- data/lib/recombee_api_client/api/recommend_items_to_item.rb +26 -26
- data/lib/recombee_api_client/api/recommend_items_to_item_segment.rb +207 -0
- data/lib/recombee_api_client/api/recommend_items_to_user.rb +23 -23
- data/lib/recombee_api_client/api/recommend_next_items.rb +2 -2
- data/lib/recombee_api_client/api/recommend_users_to_item.rb +18 -18
- data/lib/recombee_api_client/api/recommend_users_to_user.rb +21 -21
- data/lib/recombee_api_client/api/remove_from_series.rb +5 -8
- data/lib/recombee_api_client/api/reset_database.rb +1 -1
- data/lib/recombee_api_client/api/search_item_segments.rb +114 -0
- data/lib/recombee_api_client/api/search_items.rb +17 -17
- data/lib/recombee_api_client/api/set_view_portion.rb +4 -4
- data/lib/recombee_api_client/api/update_auto_reql_segmentation.rb +69 -0
- data/lib/recombee_api_client/api/update_manual_reql_segment.rb +67 -0
- data/lib/recombee_api_client/api/update_manual_reql_segmentation.rb +65 -0
- data/lib/recombee_api_client/api/update_more_items.rb +4 -4
- data/lib/recombee_api_client/api/update_property_based_segmentation.rb +69 -0
- data/lib/recombee_api_client/version.rb +1 -1
- data/lib/recombee_api_client.rb +1 -1
- data/recombee_api_client.gemspec +10 -8
- metadata +40 -31
- data/lib/recombee_api_client/api/insert_to_group.rb +0 -66
- data/lib/recombee_api_client/api/remove_from_group.rb +0 -55
@@ -0,0 +1,207 @@
|
|
1
|
+
#
|
2
|
+
# This file is auto-generated, do not edit
|
3
|
+
#
|
4
|
+
|
5
|
+
module RecombeeApiClient
|
6
|
+
require_relative 'request'
|
7
|
+
require_relative '../errors'
|
8
|
+
|
9
|
+
##
|
10
|
+
#Recommends Items that are the most relevant to a particular Segment from a context [Segmentation](https://docs.recombee.com/segmentations.html).
|
11
|
+
#
|
12
|
+
#Based on the used Segmentation, this endpoint can be used for example for:
|
13
|
+
#
|
14
|
+
#- Recommending articles related to a particular topic
|
15
|
+
#- Recommending songs belonging to a particular genre
|
16
|
+
#- Recommending products produced by a particular brand
|
17
|
+
#
|
18
|
+
#You need to set the used context Segmentation in the Admin UI in the [Scenario settings](https://docs.recombee.com/scenarios) prior to using this endpoint.
|
19
|
+
#
|
20
|
+
#The returned items are sorted by relevance (the first item being the most relevant).
|
21
|
+
#
|
22
|
+
#It is also possible to use the POST HTTP method (for example, in the case of a very long ReQL filter) — query parameters then become body parameters.
|
23
|
+
#
|
24
|
+
class RecommendItemsToItemSegment < ApiRequest
|
25
|
+
attr_reader :context_segment_id, :target_user_id, :count, :scenario, :cascade_create, :return_properties, :included_properties, :filter, :booster, :logic, :min_relevance, :rotation_rate, :rotation_time, :expert_settings, :return_ab_group
|
26
|
+
attr_accessor :timeout
|
27
|
+
attr_accessor :ensure_https
|
28
|
+
|
29
|
+
##
|
30
|
+
# * *Required arguments*
|
31
|
+
# - +context_segment_id+ -> ID of the segment from `contextSegmentationId` for which the recommendations are to be generated.
|
32
|
+
# - +target_user_id+ -> ID of the user who will see the recommendations.
|
33
|
+
#
|
34
|
+
#Specifying the *targetUserId* is beneficial because:
|
35
|
+
#
|
36
|
+
#* It makes the recommendations personalized
|
37
|
+
#* Allows the calculation of Actions and Conversions
|
38
|
+
# in the graphical user interface,
|
39
|
+
# as Recombee can pair the user who got recommendations
|
40
|
+
# and who afterward viewed/purchased an item.
|
41
|
+
#
|
42
|
+
#If you insist on not specifying the user, pass `null`
|
43
|
+
#(`None`, `nil`, `NULL` etc., depending on the language) to *targetUserId*.
|
44
|
+
#Do not create some special dummy user for getting recommendations,
|
45
|
+
#as it could mislead the recommendation models,
|
46
|
+
#and result in wrong recommendations.
|
47
|
+
#
|
48
|
+
#For anonymous/unregistered users, it is possible to use, for example, their session ID.
|
49
|
+
#
|
50
|
+
# - +count+ -> Number of items to be recommended (N for the top-N recommendation).
|
51
|
+
#
|
52
|
+
# * *Optional arguments (given as hash optional)*
|
53
|
+
# - +scenario+ -> Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
|
54
|
+
#
|
55
|
+
#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 the performance of each scenario in the Admin UI separately, so you can check how well each application performs.
|
56
|
+
#
|
57
|
+
#The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.
|
58
|
+
#
|
59
|
+
# - +cascadeCreate+ -> If an item of the given *itemId* or user of the given *targetUserId* doesn't exist in the database, it creates the missing entity/entities and returns some (non-personalized) recommendations. This allows, for example, rotations in the following recommendations for the user of the given *targetUserId*, as the user will be already known to the system.
|
60
|
+
# - +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 to easily display the recommended items to the user.
|
61
|
+
#
|
62
|
+
#Example response:
|
63
|
+
#```
|
64
|
+
# {
|
65
|
+
# "recommId": "0c6189e7-dc1a-429a-b613-192696309361",
|
66
|
+
# "recomms":
|
67
|
+
# [
|
68
|
+
# {
|
69
|
+
# "id": "tv-178",
|
70
|
+
# "values": {
|
71
|
+
# "description": "4K TV with 3D feature",
|
72
|
+
# "categories": ["Electronics", "Televisions"],
|
73
|
+
# "price": 342,
|
74
|
+
# "url": "myshop.com/tv-178"
|
75
|
+
# }
|
76
|
+
# },
|
77
|
+
# {
|
78
|
+
# "id": "mixer-42",
|
79
|
+
# "values": {
|
80
|
+
# "description": "Stainless Steel Mixer",
|
81
|
+
# "categories": ["Home & Kitchen"],
|
82
|
+
# "price": 39,
|
83
|
+
# "url": "myshop.com/mixer-42"
|
84
|
+
# }
|
85
|
+
# }
|
86
|
+
# ],
|
87
|
+
# "numberNextRecommsCalls": 0
|
88
|
+
# }
|
89
|
+
#```
|
90
|
+
#
|
91
|
+
# - +includedProperties+ -> Allows specifying which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
|
92
|
+
#
|
93
|
+
#Example response for `includedProperties=description,price`:
|
94
|
+
#```
|
95
|
+
# {
|
96
|
+
# "recommId": "6842c725-a79f-4537-a02c-f34d668a3f80",
|
97
|
+
# "recomms":
|
98
|
+
# [
|
99
|
+
# {
|
100
|
+
# "id": "tv-178",
|
101
|
+
# "values": {
|
102
|
+
# "description": "4K TV with 3D feature",
|
103
|
+
# "price": 342
|
104
|
+
# }
|
105
|
+
# },
|
106
|
+
# {
|
107
|
+
# "id": "mixer-42",
|
108
|
+
# "values": {
|
109
|
+
# "description": "Stainless Steel Mixer",
|
110
|
+
# "price": 39
|
111
|
+
# }
|
112
|
+
# }
|
113
|
+
# ],
|
114
|
+
# "numberNextRecommsCalls": 0
|
115
|
+
# }
|
116
|
+
#```
|
117
|
+
#
|
118
|
+
# - +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.
|
119
|
+
#
|
120
|
+
#Filters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
121
|
+
#
|
122
|
+
# - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to boost the recommendation rate of some items based on the values of their attributes.
|
123
|
+
#
|
124
|
+
#Boosters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
125
|
+
#
|
126
|
+
# - +logic+ -> Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
|
127
|
+
#See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
|
128
|
+
#
|
129
|
+
#The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
|
130
|
+
#
|
131
|
+
#Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
132
|
+
#
|
133
|
+
# - +minRelevance+ -> **Expert option** If the *targetUserId* is provided: Specifies the threshold of how 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 a number of items equal to *count* at any cost. If there is not enough data (such as interactions or item properties), this may even lead to bestseller-based recommendations being 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.
|
134
|
+
#
|
135
|
+
# - +rotationRate+ -> **Expert option** If the *targetUserId* is provided: 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 a 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.
|
136
|
+
#
|
137
|
+
# - +rotationTime+ -> **Expert option** If the *targetUserId* is provided: Taking *rotationRate* into account, specifies how long it takes for an item to recover from the penalization. For example, `rotationTime=7200.0` means that items recommended less than 2 hours ago are penalized.
|
138
|
+
#
|
139
|
+
# - +expertSettings+ -> Dictionary of custom options.
|
140
|
+
#
|
141
|
+
# - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
|
142
|
+
#
|
143
|
+
#
|
144
|
+
def initialize(context_segment_id, target_user_id, count, optional = {})
|
145
|
+
@context_segment_id = context_segment_id
|
146
|
+
@target_user_id = target_user_id
|
147
|
+
@count = count
|
148
|
+
optional = normalize_optional(optional)
|
149
|
+
@scenario = optional['scenario']
|
150
|
+
@cascade_create = optional['cascadeCreate']
|
151
|
+
@return_properties = optional['returnProperties']
|
152
|
+
@included_properties = optional['includedProperties']
|
153
|
+
@filter = optional['filter']
|
154
|
+
@booster = optional['booster']
|
155
|
+
@logic = optional['logic']
|
156
|
+
@min_relevance = optional['minRelevance']
|
157
|
+
@rotation_rate = optional['rotationRate']
|
158
|
+
@rotation_time = optional['rotationTime']
|
159
|
+
@expert_settings = optional['expertSettings']
|
160
|
+
@return_ab_group = optional['returnAbGroup']
|
161
|
+
@optional = optional
|
162
|
+
@timeout = 3000
|
163
|
+
@ensure_https = false
|
164
|
+
@optional.each do |par, _|
|
165
|
+
fail UnknownOptionalParameter.new(par) unless ["scenario","cascadeCreate","returnProperties","includedProperties","filter","booster","logic","minRelevance","rotationRate","rotationTime","expertSettings","returnAbGroup"].include? par
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
# HTTP method
|
170
|
+
def method
|
171
|
+
:post
|
172
|
+
end
|
173
|
+
|
174
|
+
# Values of body parameters as a Hash
|
175
|
+
def body_parameters
|
176
|
+
p = Hash.new
|
177
|
+
p['contextSegmentId'] = @context_segment_id
|
178
|
+
p['targetUserId'] = @target_user_id
|
179
|
+
p['count'] = @count
|
180
|
+
p['scenario'] = @optional['scenario'] if @optional.include? 'scenario'
|
181
|
+
p['cascadeCreate'] = @optional['cascadeCreate'] if @optional.include? 'cascadeCreate'
|
182
|
+
p['returnProperties'] = @optional['returnProperties'] if @optional.include? 'returnProperties'
|
183
|
+
p['includedProperties'] = @optional['includedProperties'] if @optional.include? 'includedProperties'
|
184
|
+
p['filter'] = @optional['filter'] if @optional.include? 'filter'
|
185
|
+
p['booster'] = @optional['booster'] if @optional.include? 'booster'
|
186
|
+
p['logic'] = @optional['logic'] if @optional.include? 'logic'
|
187
|
+
p['minRelevance'] = @optional['minRelevance'] if @optional.include? 'minRelevance'
|
188
|
+
p['rotationRate'] = @optional['rotationRate'] if @optional.include? 'rotationRate'
|
189
|
+
p['rotationTime'] = @optional['rotationTime'] if @optional.include? 'rotationTime'
|
190
|
+
p['expertSettings'] = @optional['expertSettings'] if @optional.include? 'expertSettings'
|
191
|
+
p['returnAbGroup'] = @optional['returnAbGroup'] if @optional.include? 'returnAbGroup'
|
192
|
+
p
|
193
|
+
end
|
194
|
+
|
195
|
+
# Values of query parameters as a Hash.
|
196
|
+
# name of parameter => value of the parameter
|
197
|
+
def query_parameters
|
198
|
+
params = {}
|
199
|
+
params
|
200
|
+
end
|
201
|
+
|
202
|
+
# Relative path to the endpoint
|
203
|
+
def path
|
204
|
+
"/{databaseId}/recomms/item-segments/items/"
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
@@ -7,18 +7,18 @@ module RecombeeApiClient
|
|
7
7
|
require_relative '../errors'
|
8
8
|
|
9
9
|
##
|
10
|
-
#Based on user's past interactions (purchases, ratings, etc.) with the items, recommends top-N items that are most likely to be of high value for
|
10
|
+
#Based on the user's past interactions (purchases, ratings, etc.) with the items, recommends top-N items that are most likely to be of high value for the given user.
|
11
11
|
#
|
12
|
-
#The most typical use cases are recommendations
|
12
|
+
#The most typical use cases are recommendations on the homepage, in some "Picked just for you" section, or in email.
|
13
13
|
#
|
14
|
-
#The returned items are sorted by relevance (first item being the most relevant).
|
14
|
+
#The returned items are sorted by relevance (the first item being the most relevant).
|
15
15
|
#
|
16
16
|
#Besides the recommended items, also a unique `recommId` is returned in the response. It can be used to:
|
17
17
|
#
|
18
|
-
#- Let Recombee know that this recommendation was successful (e.g
|
18
|
+
#- Let Recombee know that this recommendation was successful (e.g., user clicked one of the recommended items). See [Reported metrics](https://docs.recombee.com/admin_ui.html#reported-metrics).
|
19
19
|
#- Get subsequent recommended items when the user scrolls down (*infinite scroll*) or goes to the next page. See [Recommend Next Items](https://docs.recombee.com/api.html#recommend-next-items).
|
20
20
|
#
|
21
|
-
#It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
|
21
|
+
#It is also possible to use POST HTTP method (for example in the case of a very long ReQL filter) - query parameters then become body parameters.
|
22
22
|
#
|
23
23
|
class RecommendItemsToUser < ApiRequest
|
24
24
|
attr_reader :user_id, :count, :scenario, :cascade_create, :return_properties, :included_properties, :filter, :booster, :logic, :diversity, :min_relevance, :rotation_rate, :rotation_time, :expert_settings, :return_ab_group
|
@@ -32,15 +32,15 @@ module RecombeeApiClient
|
|
32
32
|
#
|
33
33
|
#
|
34
34
|
# * *Optional arguments (given as hash optional)*
|
35
|
-
# - +scenario+ -> Scenario defines a particular application of recommendations. It can be for example "homepage", "cart" or "emailing".
|
35
|
+
# - +scenario+ -> Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
|
36
36
|
#
|
37
|
-
#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.
|
37
|
+
#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 the performance of each scenario in the Admin UI separately, so you can check how well each application performs.
|
38
38
|
#
|
39
|
-
#The AI
|
39
|
+
#The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.
|
40
40
|
#
|
41
|
-
# - +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.
|
41
|
+
# - +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.
|
42
42
|
#
|
43
|
-
# - +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
|
43
|
+
# - +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 to easily display the recommended items to the user.
|
44
44
|
#
|
45
45
|
#Example response:
|
46
46
|
#```
|
@@ -71,7 +71,7 @@ module RecombeeApiClient
|
|
71
71
|
# }
|
72
72
|
#```
|
73
73
|
#
|
74
|
-
# - +includedProperties+ -> Allows
|
74
|
+
# - +includedProperties+ -> Allows specifying which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
|
75
75
|
#
|
76
76
|
#Example response for `includedProperties=description,price`:
|
77
77
|
#```
|
@@ -98,32 +98,32 @@ module RecombeeApiClient
|
|
98
98
|
# }
|
99
99
|
#```
|
100
100
|
#
|
101
|
-
# - +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.
|
101
|
+
# - +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.
|
102
102
|
#
|
103
|
-
#Filters can be
|
103
|
+
#Filters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
104
104
|
#
|
105
|
-
# - +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.
|
105
|
+
# - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to boost the recommendation rate of some items based on the values of their attributes.
|
106
106
|
#
|
107
|
-
#Boosters can be
|
107
|
+
#Boosters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
108
108
|
#
|
109
|
-
# - +logic+ -> Logic specifies particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
|
110
|
-
#See [this section](https://docs.recombee.com/recommendation_logics.html) for list of available logics and other details.
|
109
|
+
# - +logic+ -> Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
|
110
|
+
#See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
|
111
111
|
#
|
112
112
|
#The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
|
113
113
|
#
|
114
|
-
#Logic can be
|
114
|
+
#Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
115
115
|
#
|
116
|
-
# - +diversity+ -> **Expert option** Real number from [0.0, 1.0] which determines how
|
116
|
+
# - +diversity+ -> **Expert option** Real number from [0.0, 1.0], which determines how mutually dissimilar the recommended items should be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
|
117
117
|
#
|
118
|
-
# - +minRelevance+ -> **Expert option** Specifies the threshold of how
|
118
|
+
# - +minRelevance+ -> **Expert option** Specifies the threshold of how 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 a number of items equal to *count* at any cost. If there is 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 a 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.
|
119
119
|
#
|
120
|
-
# - +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
|
120
|
+
# - +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 a 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`.
|
121
121
|
#
|
122
|
-
# - +rotationTime+ -> **Expert option** Taking *rotationRate* into account, specifies how long
|
122
|
+
# - +rotationTime+ -> **Expert option** Taking *rotationRate* into account, specifies how long it takes for 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`.
|
123
123
|
#
|
124
124
|
# - +expertSettings+ -> Dictionary of custom options.
|
125
125
|
#
|
126
|
-
# - +returnAbGroup+ -> If there is a custom AB-testing running, return name of group to which the request belongs.
|
126
|
+
# - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
|
127
127
|
#
|
128
128
|
#
|
129
129
|
def initialize(user_id, count, optional = {})
|
@@ -7,9 +7,9 @@ module RecombeeApiClient
|
|
7
7
|
require_relative '../errors'
|
8
8
|
|
9
9
|
##
|
10
|
-
#Returns items that shall be shown to a user as next recommendations when the user e.g. scrolls the page down (*infinite scroll*) or goes to
|
10
|
+
#Returns items that shall be shown to a user as next recommendations when the user e.g. scrolls the page down (*infinite scroll*) or goes to the next page.
|
11
11
|
#
|
12
|
-
#It accepts `recommId` of a base recommendation request (e.g
|
12
|
+
#It accepts `recommId` of a base recommendation request (e.g., request from the first page) and the number of items that shall be returned (`count`).
|
13
13
|
#The base request can be one of:
|
14
14
|
# - [Recommend items to item](https://docs.recombee.com/api.html#recommend-items-to-item)
|
15
15
|
# - [Recommend items to user](https://docs.recombee.com/api.html#recommend-items-to-user)
|
@@ -7,11 +7,11 @@ module RecombeeApiClient
|
|
7
7
|
require_relative '../errors'
|
8
8
|
|
9
9
|
##
|
10
|
-
#
|
10
|
+
#Recommends users that are likely to be interested in the given item.
|
11
11
|
#
|
12
|
-
#It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
|
12
|
+
#It is also possible to use POST HTTP method (for example in the case of a very long ReQL filter) - query parameters then become body parameters.
|
13
13
|
#
|
14
|
-
#The returned users are sorted by predicted interest in the item (first user being the most interested).
|
14
|
+
#The returned users are sorted by predicted interest in the item (the first user being the most interested).
|
15
15
|
#
|
16
16
|
class RecommendUsersToItem < ApiRequest
|
17
17
|
attr_reader :item_id, :count, :scenario, :cascade_create, :return_properties, :included_properties, :filter, :booster, :logic, :diversity, :expert_settings, :return_ab_group
|
@@ -24,14 +24,14 @@ module RecombeeApiClient
|
|
24
24
|
# - +count+ -> Number of items to be recommended (N for the top-N recommendation).
|
25
25
|
#
|
26
26
|
# * *Optional arguments (given as hash optional)*
|
27
|
-
# - +scenario+ -> Scenario defines a particular application of recommendations. It can be for example "homepage", "cart" or "emailing".
|
27
|
+
# - +scenario+ -> Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
|
28
28
|
#
|
29
|
-
#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.
|
29
|
+
#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 the performance of each scenario in the Admin UI separately, so you can check how well each application performs.
|
30
30
|
#
|
31
|
-
#The AI
|
31
|
+
#The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.
|
32
32
|
#
|
33
|
-
# - +cascadeCreate+ -> If item of given *itemId* doesn't exist in the database, it creates the missing item.
|
34
|
-
# - +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
|
33
|
+
# - +cascadeCreate+ -> If an item of the given *itemId* doesn't exist in the database, it creates the missing item.
|
34
|
+
# - +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 to easily display the recommended users.
|
35
35
|
#
|
36
36
|
#Example response:
|
37
37
|
#```
|
@@ -58,7 +58,7 @@ module RecombeeApiClient
|
|
58
58
|
# }
|
59
59
|
#```
|
60
60
|
#
|
61
|
-
# - +includedProperties+ -> Allows
|
61
|
+
# - +includedProperties+ -> Allows specifying which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
|
62
62
|
#
|
63
63
|
#Example response for `includedProperties=country`:
|
64
64
|
#```
|
@@ -83,26 +83,26 @@ module RecombeeApiClient
|
|
83
83
|
# }
|
84
84
|
#```
|
85
85
|
#
|
86
|
-
# - +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.
|
86
|
+
# - +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.
|
87
87
|
#
|
88
|
-
#Filters can be
|
88
|
+
#Filters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
89
89
|
#
|
90
|
-
# - +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.
|
90
|
+
# - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to boost the recommendation rate of some items based on the values of their attributes.
|
91
91
|
#
|
92
|
-
#Boosters can be
|
92
|
+
#Boosters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
93
93
|
#
|
94
|
-
# - +logic+ -> Logic specifies particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
|
95
|
-
#See [this section](https://docs.recombee.com/recommendation_logics.html) for list of available logics and other details.
|
94
|
+
# - +logic+ -> Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
|
95
|
+
#See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
|
96
96
|
#
|
97
97
|
#The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
|
98
98
|
#
|
99
|
-
#Logic can be
|
99
|
+
#Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
100
100
|
#
|
101
|
-
# - +diversity+ -> **Expert option** Real number from [0.0, 1.0] which determines how
|
101
|
+
# - +diversity+ -> **Expert option** Real number from [0.0, 1.0], which determines how mutually dissimilar the recommended items should be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
|
102
102
|
#
|
103
103
|
# - +expertSettings+ -> Dictionary of custom options.
|
104
104
|
#
|
105
|
-
# - +returnAbGroup+ -> If there is a custom AB-testing running, return name of group to which the request belongs.
|
105
|
+
# - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
|
106
106
|
#
|
107
107
|
#
|
108
108
|
def initialize(item_id, count, optional = {})
|
@@ -7,11 +7,11 @@ module RecombeeApiClient
|
|
7
7
|
require_relative '../errors'
|
8
8
|
|
9
9
|
##
|
10
|
-
#
|
10
|
+
#Gets users similar to the given user, based on the user's past interactions (purchases, ratings, etc.) and values of properties.
|
11
11
|
#
|
12
|
-
#It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
|
12
|
+
#It is also possible to use POST HTTP method (for example in the case of a very long ReQL filter) - query parameters then become body parameters.
|
13
13
|
#
|
14
|
-
#The returned users are sorted by similarity (first user being the most similar).
|
14
|
+
#The returned users are sorted by similarity (the first user being the most similar).
|
15
15
|
#
|
16
16
|
class RecommendUsersToUser < ApiRequest
|
17
17
|
attr_reader :user_id, :count, :scenario, :cascade_create, :return_properties, :included_properties, :filter, :booster, :logic, :diversity, :min_relevance, :rotation_rate, :rotation_time, :expert_settings, :return_ab_group
|
@@ -24,14 +24,14 @@ module RecombeeApiClient
|
|
24
24
|
# - +count+ -> Number of users to be recommended (N for the top-N recommendation).
|
25
25
|
#
|
26
26
|
# * *Optional arguments (given as hash optional)*
|
27
|
-
# - +scenario+ -> Scenario defines a particular application of recommendations. It can be for example "homepage", "cart" or "emailing".
|
27
|
+
# - +scenario+ -> Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
|
28
28
|
#
|
29
|
-
#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.
|
29
|
+
#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 the performance of each scenario in the Admin UI separately, so you can check how well each application performs.
|
30
30
|
#
|
31
|
-
#The AI
|
31
|
+
#The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.
|
32
32
|
#
|
33
|
-
# - +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.
|
34
|
-
# - +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
|
33
|
+
# - +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.
|
34
|
+
# - +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 to easily display the recommended users.
|
35
35
|
#
|
36
36
|
#Example response:
|
37
37
|
#```
|
@@ -58,7 +58,7 @@ module RecombeeApiClient
|
|
58
58
|
# }
|
59
59
|
#```
|
60
60
|
#
|
61
|
-
# - +includedProperties+ -> Allows
|
61
|
+
# - +includedProperties+ -> Allows specifying which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
|
62
62
|
#
|
63
63
|
#Example response for `includedProperties=country`:
|
64
64
|
#```
|
@@ -83,32 +83,32 @@ module RecombeeApiClient
|
|
83
83
|
# }
|
84
84
|
#```
|
85
85
|
#
|
86
|
-
# - +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.
|
86
|
+
# - +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.
|
87
87
|
#
|
88
|
-
#Filters can be
|
88
|
+
#Filters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
89
89
|
#
|
90
|
-
# - +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.
|
90
|
+
# - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to boost the recommendation rate of some items based on the values of their attributes.
|
91
91
|
#
|
92
|
-
#Boosters can be
|
92
|
+
#Boosters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
93
93
|
#
|
94
|
-
# - +logic+ -> Logic specifies particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
|
95
|
-
#See [this section](https://docs.recombee.com/recommendation_logics.html) for list of available logics and other details.
|
94
|
+
# - +logic+ -> Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
|
95
|
+
#See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
|
96
96
|
#
|
97
97
|
#The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
|
98
98
|
#
|
99
|
-
#Logic can be
|
99
|
+
#Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
100
100
|
#
|
101
|
-
# - +diversity+ -> **Expert option** Real number from [0.0, 1.0] which determines how
|
101
|
+
# - +diversity+ -> **Expert option** Real number from [0.0, 1.0], which determines how mutually dissimilar the recommended users should be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
|
102
102
|
#
|
103
|
-
# - +minRelevance+ -> **Expert option** Specifies the threshold of how
|
103
|
+
# - +minRelevance+ -> **Expert option** Specifies the threshold of how relevant must the recommended users be. Possible values one of: "low", "medium", "high".
|
104
104
|
#
|
105
|
-
# - +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
|
105
|
+
# - +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 a backward fashion. You may penalize a 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.
|
106
106
|
#
|
107
|
-
# - +rotationTime+ -> **Expert option** Taking *rotationRate* into account, specifies how long
|
107
|
+
# - +rotationTime+ -> **Expert option** Taking *rotationRate* into account, specifies how long it takes for a user to recover from the penalization. For example, `rotationTime=7200.0` means that users recommended less than 2 hours ago are penalized.
|
108
108
|
#
|
109
109
|
# - +expertSettings+ -> Dictionary of custom options.
|
110
110
|
#
|
111
|
-
# - +returnAbGroup+ -> If there is a custom AB-testing running, return name of group to which the request belongs.
|
111
|
+
# - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
|
112
112
|
#
|
113
113
|
#
|
114
114
|
def initialize(user_id, count, optional = {})
|
@@ -9,7 +9,7 @@ module RecombeeApiClient
|
|
9
9
|
##
|
10
10
|
#Removes an existing series item from the series.
|
11
11
|
class RemoveFromSeries < ApiRequest
|
12
|
-
attr_reader :series_id, :item_type, :item_id
|
12
|
+
attr_reader :series_id, :item_type, :item_id
|
13
13
|
attr_accessor :timeout
|
14
14
|
attr_accessor :ensure_https
|
15
15
|
|
@@ -18,14 +18,12 @@ module RecombeeApiClient
|
|
18
18
|
# - +series_id+ -> ID of the series from which a series item is to be removed.
|
19
19
|
# - +item_type+ -> Type of the item to be removed.
|
20
20
|
# - +item_id+ -> ID of the item iff `itemType` is `item`. ID of the series iff `itemType` is `series`.
|
21
|
-
# - +time+ -> Time index of the item to be removed.
|
22
21
|
#
|
23
|
-
def initialize(series_id, item_type, item_id
|
22
|
+
def initialize(series_id, item_type, item_id)
|
24
23
|
@series_id = series_id
|
25
24
|
@item_type = item_type
|
26
25
|
@item_id = item_id
|
27
|
-
@
|
28
|
-
@timeout = 1000
|
26
|
+
@timeout = 3000
|
29
27
|
@ensure_https = false
|
30
28
|
end
|
31
29
|
|
@@ -37,6 +35,8 @@ module RecombeeApiClient
|
|
37
35
|
# Values of body parameters as a Hash
|
38
36
|
def body_parameters
|
39
37
|
p = Hash.new
|
38
|
+
p['itemType'] = @item_type
|
39
|
+
p['itemId'] = @item_id
|
40
40
|
p
|
41
41
|
end
|
42
42
|
|
@@ -44,9 +44,6 @@ module RecombeeApiClient
|
|
44
44
|
# name of parameter => value of the parameter
|
45
45
|
def query_parameters
|
46
46
|
params = {}
|
47
|
-
params['itemType'] = @item_type
|
48
|
-
params['itemId'] = @item_id
|
49
|
-
params['time'] = @time
|
50
47
|
params
|
51
48
|
end
|
52
49
|
|
@@ -7,7 +7,7 @@ module RecombeeApiClient
|
|
7
7
|
require_relative '../errors'
|
8
8
|
|
9
9
|
##
|
10
|
-
#Completely erases all your data, including items, item properties, series, user database, purchases, ratings, detail views, and bookmarks. Make sure the request
|
10
|
+
#Completely erases all your data, including items, item properties, series, user database, purchases, ratings, detail views, and bookmarks. Make sure the request is never executed in the production environment! Resetting your database is irreversible.
|
11
11
|
#
|
12
12
|
class ResetDatabase < ApiRequest
|
13
13
|
|