recombee-api-client 4.1.0 → 4.1.1

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.
Files changed (198) hide show
  1. package/lib/api-client.js +2 -2
  2. package/lib/index.d.ts +3202 -0
  3. package/lib/requests/add-bookmark.js +2 -2
  4. package/lib/requests/add-cart-addition.js +2 -2
  5. package/lib/requests/add-detail-view.js +2 -2
  6. package/lib/requests/add-purchase.js +2 -2
  7. package/lib/requests/add-rating.js +2 -2
  8. package/lib/requests/delete-more-items.js +1 -1
  9. package/lib/requests/recommend-item-segments-to-item-segment.js +2 -2
  10. package/lib/requests/recommend-item-segments-to-item.js +2 -2
  11. package/lib/requests/recommend-item-segments-to-user.js +2 -2
  12. package/lib/requests/recommend-items-to-item.js +2 -2
  13. package/lib/requests/recommend-items-to-user.js +2 -2
  14. package/lib/requests/recommend-users-to-item.js +2 -2
  15. package/lib/requests/recommend-users-to-user.js +2 -2
  16. package/lib/requests/request.js +0 -1
  17. package/lib/requests/search-item-segments.js +2 -2
  18. package/lib/requests/search-items.js +2 -2
  19. package/lib/requests/set-user-values.js +0 -1
  20. package/lib/requests/set-view-portion.js +2 -2
  21. package/lib/requests/update-more-items.js +2 -2
  22. package/package.json +2 -1
  23. package/doc/AddBookmark.html +0 -506
  24. package/doc/AddCartAddition.html +0 -512
  25. package/doc/AddDetailView.html +0 -509
  26. package/doc/AddGroup.html +0 -447
  27. package/doc/AddItem.html +0 -448
  28. package/doc/AddItemProperty.html +0 -478
  29. package/doc/AddPurchase.html +0 -515
  30. package/doc/AddRating.html +0 -529
  31. package/doc/AddSearchSynonym.html +0 -501
  32. package/doc/AddSeries.html +0 -447
  33. package/doc/AddUser.html +0 -447
  34. package/doc/AddUserProperty.html +0 -476
  35. package/doc/ApiClient.html +0 -433
  36. package/doc/ApiError.html +0 -170
  37. package/doc/Batch.html +0 -476
  38. package/doc/DeleteAllSearchSynonyms.html +0 -398
  39. package/doc/DeleteBookmark.html +0 -497
  40. package/doc/DeleteCartAddition.html +0 -497
  41. package/doc/DeleteDetailView.html +0 -497
  42. package/doc/DeleteGroup.html +0 -448
  43. package/doc/DeleteItem.html +0 -449
  44. package/doc/DeleteItemProperty.html +0 -447
  45. package/doc/DeleteMoreItems.html +0 -448
  46. package/doc/DeletePurchase.html +0 -497
  47. package/doc/DeleteRating.html +0 -497
  48. package/doc/DeleteSearchSynonym.html +0 -447
  49. package/doc/DeleteSeries.html +0 -448
  50. package/doc/DeleteUser.html +0 -448
  51. package/doc/DeleteUserProperty.html +0 -447
  52. package/doc/DeleteViewPortion.html +0 -497
  53. package/doc/GetItemPropertyInfo.html +0 -447
  54. package/doc/GetItemValues.html +0 -447
  55. package/doc/GetUserPropertyInfo.html +0 -447
  56. package/doc/GetUserValues.html +0 -447
  57. package/doc/InsertToGroup.html +0 -520
  58. package/doc/InsertToSeries.html +0 -543
  59. package/doc/ListGroupItems.html +0 -447
  60. package/doc/ListGroups.html +0 -398
  61. package/doc/ListItemBookmarks.html +0 -447
  62. package/doc/ListItemCartAdditions.html +0 -447
  63. package/doc/ListItemDetailViews.html +0 -447
  64. package/doc/ListItemProperties.html +0 -398
  65. package/doc/ListItemPurchases.html +0 -447
  66. package/doc/ListItemRatings.html +0 -447
  67. package/doc/ListItemViewPortions.html +0 -447
  68. package/doc/ListItems.html +0 -497
  69. package/doc/ListSearchSynonyms.html +0 -454
  70. package/doc/ListSeries.html +0 -398
  71. package/doc/ListSeriesItems.html +0 -447
  72. package/doc/ListUserBookmarks.html +0 -447
  73. package/doc/ListUserCartAdditions.html +0 -447
  74. package/doc/ListUserDetailViews.html +0 -447
  75. package/doc/ListUserProperties.html +0 -398
  76. package/doc/ListUserPurchases.html +0 -447
  77. package/doc/ListUserRatings.html +0 -447
  78. package/doc/ListUserViewPortions.html +0 -447
  79. package/doc/ListUsers.html +0 -491
  80. package/doc/MergeUsers.html +0 -498
  81. package/doc/RecommendItemsToItem.html +0 -635
  82. package/doc/RecommendItemsToUser.html +0 -598
  83. package/doc/RecommendNextItems.html +0 -480
  84. package/doc/RecommendUsersToItem.html +0 -579
  85. package/doc/RecommendUsersToUser.html +0 -588
  86. package/doc/RemoveFromGroup.html +0 -493
  87. package/doc/RemoveFromSeries.html +0 -516
  88. package/doc/Request.html +0 -292
  89. package/doc/ResetDatabase.html +0 -398
  90. package/doc/ResponseError.html +0 -269
  91. package/doc/SearchItems.html +0 -610
  92. package/doc/SetItemValues.html +0 -279
  93. package/doc/SetUserValues.html +0 -277
  94. package/doc/SetValues.html +0 -480
  95. package/doc/SetViewPortion.html +0 -533
  96. package/doc/TimeoutError.html +0 -246
  97. package/doc/UpdateMoreItems.html +0 -472
  98. package/doc/api-client.js.html +0 -248
  99. package/doc/errors_api-error.js.html +0 -71
  100. package/doc/errors_response-error.js.html +0 -72
  101. package/doc/errors_timeout-error.js.html +0 -71
  102. package/doc/fonts/OpenSans-Bold-webfont.eot +0 -0
  103. package/doc/fonts/OpenSans-Bold-webfont.svg +0 -1830
  104. package/doc/fonts/OpenSans-Bold-webfont.woff +0 -0
  105. package/doc/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  106. package/doc/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  107. package/doc/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  108. package/doc/fonts/OpenSans-Italic-webfont.eot +0 -0
  109. package/doc/fonts/OpenSans-Italic-webfont.svg +0 -1830
  110. package/doc/fonts/OpenSans-Italic-webfont.woff +0 -0
  111. package/doc/fonts/OpenSans-Light-webfont.eot +0 -0
  112. package/doc/fonts/OpenSans-Light-webfont.svg +0 -1831
  113. package/doc/fonts/OpenSans-Light-webfont.woff +0 -0
  114. package/doc/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  115. package/doc/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  116. package/doc/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  117. package/doc/fonts/OpenSans-Regular-webfont.eot +0 -0
  118. package/doc/fonts/OpenSans-Regular-webfont.svg +0 -1831
  119. package/doc/fonts/OpenSans-Regular-webfont.woff +0 -0
  120. package/doc/index.html +0 -65
  121. package/doc/requests_add-bookmark.js.html +0 -128
  122. package/doc/requests_add-cart-addition.js.html +0 -142
  123. package/doc/requests_add-detail-view.js.html +0 -135
  124. package/doc/requests_add-group.js.html +0 -93
  125. package/doc/requests_add-item-property.js.html +0 -104
  126. package/doc/requests_add-item.js.html +0 -94
  127. package/doc/requests_add-purchase.js.html +0 -149
  128. package/doc/requests_add-rating.js.html +0 -131
  129. package/doc/requests_add-search-synonym.js.html +0 -111
  130. package/doc/requests_add-series.js.html +0 -93
  131. package/doc/requests_add-user-property.js.html +0 -102
  132. package/doc/requests_add-user.js.html +0 -93
  133. package/doc/requests_batch.js.html +0 -121
  134. package/doc/requests_delete-all-search-synonyms.js.html +0 -91
  135. package/doc/requests_delete-bookmark.js.html +0 -106
  136. package/doc/requests_delete-cart-addition.js.html +0 -106
  137. package/doc/requests_delete-detail-view.js.html +0 -106
  138. package/doc/requests_delete-group.js.html +0 -94
  139. package/doc/requests_delete-item-property.js.html +0 -93
  140. package/doc/requests_delete-item.js.html +0 -95
  141. package/doc/requests_delete-more-items.js.html +0 -95
  142. package/doc/requests_delete-purchase.js.html +0 -106
  143. package/doc/requests_delete-rating.js.html +0 -106
  144. package/doc/requests_delete-search-synonym.js.html +0 -93
  145. package/doc/requests_delete-series.js.html +0 -94
  146. package/doc/requests_delete-user-property.js.html +0 -93
  147. package/doc/requests_delete-user.js.html +0 -94
  148. package/doc/requests_delete-view-portion.js.html +0 -106
  149. package/doc/requests_get-item-property-info.js.html +0 -93
  150. package/doc/requests_get-item-values.js.html +0 -93
  151. package/doc/requests_get-user-property-info.js.html +0 -93
  152. package/doc/requests_get-user-values.js.html +0 -93
  153. package/doc/requests_insert-to-group.js.html +0 -109
  154. package/doc/requests_insert-to-series.js.html +0 -112
  155. package/doc/requests_list-group-items.js.html +0 -93
  156. package/doc/requests_list-groups.js.html +0 -91
  157. package/doc/requests_list-item-bookmarks.js.html +0 -93
  158. package/doc/requests_list-item-cart-additions.js.html +0 -93
  159. package/doc/requests_list-item-detail-views.js.html +0 -93
  160. package/doc/requests_list-item-properties.js.html +0 -91
  161. package/doc/requests_list-item-purchases.js.html +0 -93
  162. package/doc/requests_list-item-ratings.js.html +0 -93
  163. package/doc/requests_list-item-view-portions.js.html +0 -93
  164. package/doc/requests_list-items.js.html +0 -158
  165. package/doc/requests_list-search-synonyms.js.html +0 -106
  166. package/doc/requests_list-series-items.js.html +0 -93
  167. package/doc/requests_list-series.js.html +0 -91
  168. package/doc/requests_list-user-bookmarks.js.html +0 -93
  169. package/doc/requests_list-user-cart-additions.js.html +0 -93
  170. package/doc/requests_list-user-detail-views.js.html +0 -93
  171. package/doc/requests_list-user-properties.js.html +0 -91
  172. package/doc/requests_list-user-purchases.js.html +0 -93
  173. package/doc/requests_list-user-ratings.js.html +0 -93
  174. package/doc/requests_list-user-view-portions.js.html +0 -93
  175. package/doc/requests_list-users.js.html +0 -152
  176. package/doc/requests_merge-users.js.html +0 -105
  177. package/doc/requests_recommend-items-to-item.js.html +0 -276
  178. package/doc/requests_recommend-items-to-user.js.html +0 -255
  179. package/doc/requests_recommend-next-items.js.html +0 -106
  180. package/doc/requests_recommend-users-to-item.js.html +0 -224
  181. package/doc/requests_recommend-users-to-user.js.html +0 -245
  182. package/doc/requests_remove-from-group.js.html +0 -99
  183. package/doc/requests_remove-from-series.js.html +0 -102
  184. package/doc/requests_request.js.html +0 -73
  185. package/doc/requests_reset-database.js.html +0 -91
  186. package/doc/requests_search-items.js.html +0 -231
  187. package/doc/requests_set-item-values.js.html +0 -80
  188. package/doc/requests_set-user-values.js.html +0 -79
  189. package/doc/requests_set-values.js.html +0 -102
  190. package/doc/requests_set-view-portion.js.html +0 -139
  191. package/doc/requests_update-more-items.js.html +0 -104
  192. package/doc/scripts/linenumber.js +0 -25
  193. package/doc/scripts/prettify/Apache-License-2.0.txt +0 -202
  194. package/doc/scripts/prettify/lang-css.js +0 -2
  195. package/doc/scripts/prettify/prettify.js +0 -28
  196. package/doc/styles/jsdoc-default.css +0 -358
  197. package/doc/styles/prettify-jsdoc.css +0 -111
  198. package/doc/styles/prettify-tomorrow.css +0 -132
@@ -1,276 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>JSDoc: Source: requests/recommend-items-to-item.js</title>
6
-
7
- <script src="scripts/prettify/prettify.js"> </script>
8
- <script src="scripts/prettify/lang-css.js"> </script>
9
- <!--[if lt IE 9]>
10
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11
- <![endif]-->
12
- <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13
- <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14
- </head>
15
-
16
- <body>
17
-
18
- <div id="main">
19
-
20
- <h1 class="page-title">Source: requests/recommend-items-to-item.js</h1>
21
-
22
-
23
-
24
-
25
-
26
-
27
- <section>
28
- <article>
29
- <pre class="prettyprint source linenums"><code>/*
30
- This file is auto-generated, do not edit
31
- */
32
-
33
- 'use strict';
34
- const rqs = require("./request");
35
-
36
- /**
37
- * Recommends set of items that are somehow related to one given item, *X*. Typical scenario is when user *A* is viewing *X*. Then you may display items to the user that he might be also interested in. Recommend items to item request gives you Top-N such items, optionally taking the target user *A* into account.
38
- * The returned items are sorted by relevance (first item being the most relevant).
39
- * Besides the recommended items, also a unique `recommId` is returned in the response. It can be used to:
40
- * - 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).
41
- * - 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).
42
- * It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
43
- */
44
- class RecommendItemsToItem extends rqs.Request {
45
-
46
- /**
47
- * Construct the request
48
- * @param {string} itemId - ID of the item for which the recommendations are to be generated.
49
- * @param {string} targetUserId - ID of the user who will see the recommendations.
50
- * Specifying the *targetUserId* is beneficial because:
51
- * * It makes the recommendations personalized
52
- * * Allows the calculation of Actions and Conversions
53
- * in the graphical user interface,
54
- * as Recombee can pair the user who got recommendations
55
- * and who afterwards viewed/purchased an item.
56
- * If you insist on not specifying the user, pass `null`
57
- * (`None`, `nil`, `NULL` etc. depending on language) to *targetUserId*.
58
- * Do not create some special dummy user for getting recommendations,
59
- * as it could mislead the recommendation models,
60
- * and result in wrong recommendations.
61
- * For anonymous/unregistered users it is possible to use for example their session ID.
62
- * @param {number} count - Number of items to be recommended (N for the top-N recommendation).
63
- * @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
64
- * - Allowed parameters:
65
- * - *scenario*
66
- * - Type: string
67
- * - Description: Scenario defines a particular application of recommendations. It can be for example "homepage", "cart" or "emailing".
68
- * 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.
69
- * 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.
70
- * - *cascadeCreate*
71
- * - Type: boolean
72
- * - Description: If item of given *itemId* or user of 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 given *targetUserId*, as the user will be already known to the system.
73
- * - *returnProperties*
74
- * - Type: boolean
75
- * - Description: 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.
76
- * Example response:
77
- * ```
78
- * {
79
- * "recommId": "0c6189e7-dc1a-429a-b613-192696309361",
80
- * "recomms":
81
- * [
82
- * {
83
- * "id": "tv-178",
84
- * "values": {
85
- * "description": "4K TV with 3D feature",
86
- * "categories": ["Electronics", "Televisions"],
87
- * "price": 342,
88
- * "url": "myshop.com/tv-178"
89
- * }
90
- * },
91
- * {
92
- * "id": "mixer-42",
93
- * "values": {
94
- * "description": "Stainless Steel Mixer",
95
- * "categories": ["Home &amp; Kitchen"],
96
- * "price": 39,
97
- * "url": "myshop.com/mixer-42"
98
- * }
99
- * }
100
- * ],
101
- * "numberNextRecommsCalls": 0
102
- * }
103
- * ```
104
- * - *includedProperties*
105
- * - Type: string[]
106
- * - Description: Allows to specify, which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
107
- * Example response for `includedProperties=description,price`:
108
- * ```
109
- * {
110
- * "recommId": "6842c725-a79f-4537-a02c-f34d668a3f80",
111
- * "recomms":
112
- * [
113
- * {
114
- * "id": "tv-178",
115
- * "values": {
116
- * "description": "4K TV with 3D feature",
117
- * "price": 342
118
- * }
119
- * },
120
- * {
121
- * "id": "mixer-42",
122
- * "values": {
123
- * "description": "Stainless Steel Mixer",
124
- * "price": 39
125
- * }
126
- * }
127
- * ],
128
- * "numberNextRecommsCalls": 0
129
- * }
130
- * ```
131
- * - *filter*
132
- * - Type: string
133
- * - Description: Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended items based on the values of their attributes.
134
- * Filters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
135
- * - *booster*
136
- * - Type: string
137
- * - Description: 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.
138
- * Boosters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
139
- * - *logic*
140
- * - Type: string|
141
- * - Description: Logic specifies particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
142
- * See [this section](https://docs.recombee.com/recommendation_logics.html) for list of available logics and other details.
143
- * The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
144
- * Logic can be also set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
145
- * - *userImpact*
146
- * - Type: number
147
- * - Description: **Expert option** If *targetUserId* parameter is present, the recommendations are biased towards the given user. Using *userImpact*, you may control this bias. For an extreme case of `userImpact=0.0`, the interactions made by the user are not taken into account at all (with the exception of history-based blacklisting), for `userImpact=1.0`, you'll get user-based recommendation. The default value is `0`.
148
- * - *diversity*
149
- * - Type: number
150
- * - Description: **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.
151
- * - *minRelevance*
152
- * - Type: string
153
- * - Description: **Expert option** If the *targetUserId* is provided: 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.
154
- * - *rotationRate*
155
- * - Type: number
156
- * - Description: **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 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.
157
- * - *rotationTime*
158
- * - Type: number
159
- * - Description: **Expert option** If the *targetUserId* is provided: 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.
160
- * - *expertSettings*
161
- * - Type:
162
- * - Description: Dictionary of custom options.
163
- * - *returnAbGroup*
164
- * - Type: boolean
165
- * - Description: If there is a custom AB-testing running, return name of group to which the request belongs.
166
- */
167
- constructor(itemId, targetUserId, count, optional) {
168
- super('POST', `/recomms/items/${itemId}/items/`, 3000, false);
169
- this.itemId = itemId;
170
- this.targetUserId = targetUserId;
171
- this.count = count;
172
- optional = optional || {};
173
- this.scenario = optional.scenario;
174
- this.cascadeCreate = optional.cascadeCreate;
175
- this.returnProperties = optional.returnProperties;
176
- this.includedProperties = optional.includedProperties;
177
- this.filter = optional.filter;
178
- this.booster = optional.booster;
179
- this.logic = optional.logic;
180
- this.userImpact = optional.userImpact;
181
- this.diversity = optional.diversity;
182
- this.minRelevance = optional.minRelevance;
183
- this.rotationRate = optional.rotationRate;
184
- this.rotationTime = optional.rotationTime;
185
- this.expertSettings = optional.expertSettings;
186
- this.returnAbGroup = optional.returnAbGroup;
187
- }
188
-
189
- /**
190
- * Get body parameters
191
- * @return {Object} The values of body parameters (name of parameter: value of the parameter)
192
- */
193
- bodyParameters() {
194
- let params = {};
195
- params.targetUserId = this.targetUserId;
196
- params.count = this.count;
197
-
198
- if(this.scenario !== undefined)
199
- params.scenario = this.scenario;
200
-
201
- if(this.cascadeCreate !== undefined)
202
- params.cascadeCreate = this.cascadeCreate;
203
-
204
- if(this.returnProperties !== undefined)
205
- params.returnProperties = this.returnProperties;
206
-
207
- if(this.includedProperties !== undefined)
208
- params.includedProperties = this.includedProperties;
209
-
210
- if(this.filter !== undefined)
211
- params.filter = this.filter;
212
-
213
- if(this.booster !== undefined)
214
- params.booster = this.booster;
215
-
216
- if(this.logic !== undefined)
217
- params.logic = this.logic;
218
-
219
- if(this.userImpact !== undefined)
220
- params.userImpact = this.userImpact;
221
-
222
- if(this.diversity !== undefined)
223
- params.diversity = this.diversity;
224
-
225
- if(this.minRelevance !== undefined)
226
- params.minRelevance = this.minRelevance;
227
-
228
- if(this.rotationRate !== undefined)
229
- params.rotationRate = this.rotationRate;
230
-
231
- if(this.rotationTime !== undefined)
232
- params.rotationTime = this.rotationTime;
233
-
234
- if(this.expertSettings !== undefined)
235
- params.expertSettings = this.expertSettings;
236
-
237
- if(this.returnAbGroup !== undefined)
238
- params.returnAbGroup = this.returnAbGroup;
239
-
240
- return params;
241
- }
242
-
243
- /**
244
- * Get query parameters
245
- * @return {Object} The values of query parameters (name of parameter: value of the parameter)
246
- */
247
- queryParameters() {
248
- let params = {};
249
- return params;
250
- }
251
- }
252
-
253
- exports.RecommendItemsToItem = RecommendItemsToItem
254
- </code></pre>
255
- </article>
256
- </section>
257
-
258
-
259
-
260
-
261
- </div>
262
-
263
- <nav>
264
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookmark.html">AddBookmark</a></li><li><a href="AddCartAddition.html">AddCartAddition</a></li><li><a href="AddDetailView.html">AddDetailView</a></li><li><a href="AddGroup.html">AddGroup</a></li><li><a href="AddItem.html">AddItem</a></li><li><a href="AddItemProperty.html">AddItemProperty</a></li><li><a href="AddPurchase.html">AddPurchase</a></li><li><a href="AddRating.html">AddRating</a></li><li><a href="AddSearchSynonym.html">AddSearchSynonym</a></li><li><a href="AddSeries.html">AddSeries</a></li><li><a href="AddUser.html">AddUser</a></li><li><a href="AddUserProperty.html">AddUserProperty</a></li><li><a href="ApiClient.html">ApiClient</a></li><li><a href="ApiError.html">ApiError</a></li><li><a href="Batch.html">Batch</a></li><li><a href="DeleteAllSearchSynonyms.html">DeleteAllSearchSynonyms</a></li><li><a href="DeleteBookmark.html">DeleteBookmark</a></li><li><a href="DeleteCartAddition.html">DeleteCartAddition</a></li><li><a href="DeleteDetailView.html">DeleteDetailView</a></li><li><a href="DeleteGroup.html">DeleteGroup</a></li><li><a href="DeleteItem.html">DeleteItem</a></li><li><a href="DeleteItemProperty.html">DeleteItemProperty</a></li><li><a href="DeleteMoreItems.html">DeleteMoreItems</a></li><li><a href="DeletePurchase.html">DeletePurchase</a></li><li><a href="DeleteRating.html">DeleteRating</a></li><li><a href="DeleteSearchSynonym.html">DeleteSearchSynonym</a></li><li><a href="DeleteSeries.html">DeleteSeries</a></li><li><a href="DeleteUser.html">DeleteUser</a></li><li><a href="DeleteUserProperty.html">DeleteUserProperty</a></li><li><a href="DeleteViewPortion.html">DeleteViewPortion</a></li><li><a href="GetItemPropertyInfo.html">GetItemPropertyInfo</a></li><li><a href="GetItemValues.html">GetItemValues</a></li><li><a href="GetUserPropertyInfo.html">GetUserPropertyInfo</a></li><li><a href="GetUserValues.html">GetUserValues</a></li><li><a href="InsertToGroup.html">InsertToGroup</a></li><li><a href="InsertToSeries.html">InsertToSeries</a></li><li><a href="ListGroupItems.html">ListGroupItems</a></li><li><a href="ListGroups.html">ListGroups</a></li><li><a href="ListItemBookmarks.html">ListItemBookmarks</a></li><li><a href="ListItemCartAdditions.html">ListItemCartAdditions</a></li><li><a href="ListItemDetailViews.html">ListItemDetailViews</a></li><li><a href="ListItemProperties.html">ListItemProperties</a></li><li><a href="ListItemPurchases.html">ListItemPurchases</a></li><li><a href="ListItemRatings.html">ListItemRatings</a></li><li><a href="ListItems.html">ListItems</a></li><li><a href="ListItemViewPortions.html">ListItemViewPortions</a></li><li><a href="ListSearchSynonyms.html">ListSearchSynonyms</a></li><li><a href="ListSeries.html">ListSeries</a></li><li><a href="ListSeriesItems.html">ListSeriesItems</a></li><li><a href="ListUserBookmarks.html">ListUserBookmarks</a></li><li><a href="ListUserCartAdditions.html">ListUserCartAdditions</a></li><li><a href="ListUserDetailViews.html">ListUserDetailViews</a></li><li><a href="ListUserProperties.html">ListUserProperties</a></li><li><a href="ListUserPurchases.html">ListUserPurchases</a></li><li><a href="ListUserRatings.html">ListUserRatings</a></li><li><a href="ListUsers.html">ListUsers</a></li><li><a href="ListUserViewPortions.html">ListUserViewPortions</a></li><li><a href="MergeUsers.html">MergeUsers</a></li><li><a href="RecommendItemsToItem.html">RecommendItemsToItem</a></li><li><a href="RecommendItemsToUser.html">RecommendItemsToUser</a></li><li><a href="RecommendNextItems.html">RecommendNextItems</a></li><li><a href="RecommendUsersToItem.html">RecommendUsersToItem</a></li><li><a href="RecommendUsersToUser.html">RecommendUsersToUser</a></li><li><a href="RemoveFromGroup.html">RemoveFromGroup</a></li><li><a href="RemoveFromSeries.html">RemoveFromSeries</a></li><li><a href="Request.html">Request</a></li><li><a href="ResetDatabase.html">ResetDatabase</a></li><li><a href="ResponseError.html">ResponseError</a></li><li><a href="SearchItems.html">SearchItems</a></li><li><a href="SetItemValues.html">SetItemValues</a></li><li><a href="SetUserValues.html">SetUserValues</a></li><li><a href="SetValues.html">SetValues</a></li><li><a href="SetViewPortion.html">SetViewPortion</a></li><li><a href="TimeoutError.html">TimeoutError</a></li><li><a href="UpdateMoreItems.html">UpdateMoreItems</a></li></ul>
265
- </nav>
266
-
267
- <br class="clear">
268
-
269
- <footer>
270
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Apr 25 2022 16:02:57 GMT+0200 (Central European Summer Time)
271
- </footer>
272
-
273
- <script> prettyPrint(); </script>
274
- <script src="scripts/linenumber.js"> </script>
275
- </body>
276
- </html>
@@ -1,255 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>JSDoc: Source: requests/recommend-items-to-user.js</title>
6
-
7
- <script src="scripts/prettify/prettify.js"> </script>
8
- <script src="scripts/prettify/lang-css.js"> </script>
9
- <!--[if lt IE 9]>
10
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11
- <![endif]-->
12
- <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13
- <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14
- </head>
15
-
16
- <body>
17
-
18
- <div id="main">
19
-
20
- <h1 class="page-title">Source: requests/recommend-items-to-user.js</h1>
21
-
22
-
23
-
24
-
25
-
26
-
27
- <section>
28
- <article>
29
- <pre class="prettyprint source linenums"><code>/*
30
- This file is auto-generated, do not edit
31
- */
32
-
33
- 'use strict';
34
- const rqs = require("./request");
35
-
36
- /**
37
- * 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 a given user.
38
- * The most typical use cases are recommendations at homepage, in some "Picked just for you" section or in email.
39
- * The returned items are sorted by relevance (first item being the most relevant).
40
- * Besides the recommended items, also a unique `recommId` is returned in the response. It can be used to:
41
- * - 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).
42
- * - 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).
43
- * It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
44
- */
45
- class RecommendItemsToUser extends rqs.Request {
46
-
47
- /**
48
- * Construct the request
49
- * @param {string} userId - ID of the user for whom personalized recommendations are to be generated.
50
- * @param {number} count - Number of items to be recommended (N for the top-N recommendation).
51
- * @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
52
- * - Allowed parameters:
53
- * - *scenario*
54
- * - Type: string
55
- * - Description: Scenario defines a particular application of recommendations. It can be for example "homepage", "cart" or "emailing".
56
- * 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.
57
- * 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.
58
- * - *cascadeCreate*
59
- * - Type: boolean
60
- * - Description: 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.
61
- * - *returnProperties*
62
- * - Type: boolean
63
- * - Description: 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.
64
- * Example response:
65
- * ```
66
- * {
67
- * "recommId": "ce52ada4-e4d9-4885-943c-407db2dee837",
68
- * "recomms":
69
- * [
70
- * {
71
- * "id": "tv-178",
72
- * "values": {
73
- * "description": "4K TV with 3D feature",
74
- * "categories": ["Electronics", "Televisions"],
75
- * "price": 342,
76
- * "url": "myshop.com/tv-178"
77
- * }
78
- * },
79
- * {
80
- * "id": "mixer-42",
81
- * "values": {
82
- * "description": "Stainless Steel Mixer",
83
- * "categories": ["Home &amp; Kitchen"],
84
- * "price": 39,
85
- * "url": "myshop.com/mixer-42"
86
- * }
87
- * }
88
- * ],
89
- * "numberNextRecommsCalls": 0
90
- * }
91
- * ```
92
- * - *includedProperties*
93
- * - Type: string[]
94
- * - Description: Allows to specify, which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
95
- * Example response for `includedProperties=description,price`:
96
- * ```
97
- * {
98
- * "recommId": "a86ee8d5-cd8e-46d1-886c-8b3771d0520b",
99
- * "recomms":
100
- * [
101
- * {
102
- * "id": "tv-178",
103
- * "values": {
104
- * "description": "4K TV with 3D feature",
105
- * "price": 342
106
- * }
107
- * },
108
- * {
109
- * "id": "mixer-42",
110
- * "values": {
111
- * "description": "Stainless Steel Mixer",
112
- * "price": 39
113
- * }
114
- * }
115
- * ],
116
- * "numberNextRecommsCalls": 0
117
- * }
118
- * ```
119
- * - *filter*
120
- * - Type: string
121
- * - Description: Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended items based on the values of their attributes.
122
- * Filters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
123
- * - *booster*
124
- * - Type: string
125
- * - Description: 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.
126
- * Boosters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
127
- * - *logic*
128
- * - Type: string|
129
- * - Description: Logic specifies particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
130
- * See [this section](https://docs.recombee.com/recommendation_logics.html) for list of available logics and other details.
131
- * The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
132
- * Logic can be also set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
133
- * - *diversity*
134
- * - Type: number
135
- * - Description: **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.
136
- * - *minRelevance*
137
- * - Type: string
138
- * - Description: **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.
139
- * - *rotationRate*
140
- * - Type: number
141
- * - Description: **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`.
142
- * - *rotationTime*
143
- * - Type: number
144
- * - Description: **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`.
145
- * - *expertSettings*
146
- * - Type:
147
- * - Description: Dictionary of custom options.
148
- * - *returnAbGroup*
149
- * - Type: boolean
150
- * - Description: If there is a custom AB-testing running, return name of group to which the request belongs.
151
- */
152
- constructor(userId, count, optional) {
153
- super('POST', `/recomms/users/${userId}/items/`, 3000, false);
154
- this.userId = userId;
155
- this.count = count;
156
- optional = optional || {};
157
- this.scenario = optional.scenario;
158
- this.cascadeCreate = optional.cascadeCreate;
159
- this.returnProperties = optional.returnProperties;
160
- this.includedProperties = optional.includedProperties;
161
- this.filter = optional.filter;
162
- this.booster = optional.booster;
163
- this.logic = optional.logic;
164
- this.diversity = optional.diversity;
165
- this.minRelevance = optional.minRelevance;
166
- this.rotationRate = optional.rotationRate;
167
- this.rotationTime = optional.rotationTime;
168
- this.expertSettings = optional.expertSettings;
169
- this.returnAbGroup = optional.returnAbGroup;
170
- }
171
-
172
- /**
173
- * Get body parameters
174
- * @return {Object} The values of body parameters (name of parameter: value of the parameter)
175
- */
176
- bodyParameters() {
177
- let params = {};
178
- params.count = this.count;
179
-
180
- if(this.scenario !== undefined)
181
- params.scenario = this.scenario;
182
-
183
- if(this.cascadeCreate !== undefined)
184
- params.cascadeCreate = this.cascadeCreate;
185
-
186
- if(this.returnProperties !== undefined)
187
- params.returnProperties = this.returnProperties;
188
-
189
- if(this.includedProperties !== undefined)
190
- params.includedProperties = this.includedProperties;
191
-
192
- if(this.filter !== undefined)
193
- params.filter = this.filter;
194
-
195
- if(this.booster !== undefined)
196
- params.booster = this.booster;
197
-
198
- if(this.logic !== undefined)
199
- params.logic = this.logic;
200
-
201
- if(this.diversity !== undefined)
202
- params.diversity = this.diversity;
203
-
204
- if(this.minRelevance !== undefined)
205
- params.minRelevance = this.minRelevance;
206
-
207
- if(this.rotationRate !== undefined)
208
- params.rotationRate = this.rotationRate;
209
-
210
- if(this.rotationTime !== undefined)
211
- params.rotationTime = this.rotationTime;
212
-
213
- if(this.expertSettings !== undefined)
214
- params.expertSettings = this.expertSettings;
215
-
216
- if(this.returnAbGroup !== undefined)
217
- params.returnAbGroup = this.returnAbGroup;
218
-
219
- return params;
220
- }
221
-
222
- /**
223
- * Get query parameters
224
- * @return {Object} The values of query parameters (name of parameter: value of the parameter)
225
- */
226
- queryParameters() {
227
- let params = {};
228
- return params;
229
- }
230
- }
231
-
232
- exports.RecommendItemsToUser = RecommendItemsToUser
233
- </code></pre>
234
- </article>
235
- </section>
236
-
237
-
238
-
239
-
240
- </div>
241
-
242
- <nav>
243
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookmark.html">AddBookmark</a></li><li><a href="AddCartAddition.html">AddCartAddition</a></li><li><a href="AddDetailView.html">AddDetailView</a></li><li><a href="AddGroup.html">AddGroup</a></li><li><a href="AddItem.html">AddItem</a></li><li><a href="AddItemProperty.html">AddItemProperty</a></li><li><a href="AddPurchase.html">AddPurchase</a></li><li><a href="AddRating.html">AddRating</a></li><li><a href="AddSearchSynonym.html">AddSearchSynonym</a></li><li><a href="AddSeries.html">AddSeries</a></li><li><a href="AddUser.html">AddUser</a></li><li><a href="AddUserProperty.html">AddUserProperty</a></li><li><a href="ApiClient.html">ApiClient</a></li><li><a href="ApiError.html">ApiError</a></li><li><a href="Batch.html">Batch</a></li><li><a href="DeleteAllSearchSynonyms.html">DeleteAllSearchSynonyms</a></li><li><a href="DeleteBookmark.html">DeleteBookmark</a></li><li><a href="DeleteCartAddition.html">DeleteCartAddition</a></li><li><a href="DeleteDetailView.html">DeleteDetailView</a></li><li><a href="DeleteGroup.html">DeleteGroup</a></li><li><a href="DeleteItem.html">DeleteItem</a></li><li><a href="DeleteItemProperty.html">DeleteItemProperty</a></li><li><a href="DeleteMoreItems.html">DeleteMoreItems</a></li><li><a href="DeletePurchase.html">DeletePurchase</a></li><li><a href="DeleteRating.html">DeleteRating</a></li><li><a href="DeleteSearchSynonym.html">DeleteSearchSynonym</a></li><li><a href="DeleteSeries.html">DeleteSeries</a></li><li><a href="DeleteUser.html">DeleteUser</a></li><li><a href="DeleteUserProperty.html">DeleteUserProperty</a></li><li><a href="DeleteViewPortion.html">DeleteViewPortion</a></li><li><a href="GetItemPropertyInfo.html">GetItemPropertyInfo</a></li><li><a href="GetItemValues.html">GetItemValues</a></li><li><a href="GetUserPropertyInfo.html">GetUserPropertyInfo</a></li><li><a href="GetUserValues.html">GetUserValues</a></li><li><a href="InsertToGroup.html">InsertToGroup</a></li><li><a href="InsertToSeries.html">InsertToSeries</a></li><li><a href="ListGroupItems.html">ListGroupItems</a></li><li><a href="ListGroups.html">ListGroups</a></li><li><a href="ListItemBookmarks.html">ListItemBookmarks</a></li><li><a href="ListItemCartAdditions.html">ListItemCartAdditions</a></li><li><a href="ListItemDetailViews.html">ListItemDetailViews</a></li><li><a href="ListItemProperties.html">ListItemProperties</a></li><li><a href="ListItemPurchases.html">ListItemPurchases</a></li><li><a href="ListItemRatings.html">ListItemRatings</a></li><li><a href="ListItems.html">ListItems</a></li><li><a href="ListItemViewPortions.html">ListItemViewPortions</a></li><li><a href="ListSearchSynonyms.html">ListSearchSynonyms</a></li><li><a href="ListSeries.html">ListSeries</a></li><li><a href="ListSeriesItems.html">ListSeriesItems</a></li><li><a href="ListUserBookmarks.html">ListUserBookmarks</a></li><li><a href="ListUserCartAdditions.html">ListUserCartAdditions</a></li><li><a href="ListUserDetailViews.html">ListUserDetailViews</a></li><li><a href="ListUserProperties.html">ListUserProperties</a></li><li><a href="ListUserPurchases.html">ListUserPurchases</a></li><li><a href="ListUserRatings.html">ListUserRatings</a></li><li><a href="ListUsers.html">ListUsers</a></li><li><a href="ListUserViewPortions.html">ListUserViewPortions</a></li><li><a href="MergeUsers.html">MergeUsers</a></li><li><a href="RecommendItemsToItem.html">RecommendItemsToItem</a></li><li><a href="RecommendItemsToUser.html">RecommendItemsToUser</a></li><li><a href="RecommendNextItems.html">RecommendNextItems</a></li><li><a href="RecommendUsersToItem.html">RecommendUsersToItem</a></li><li><a href="RecommendUsersToUser.html">RecommendUsersToUser</a></li><li><a href="RemoveFromGroup.html">RemoveFromGroup</a></li><li><a href="RemoveFromSeries.html">RemoveFromSeries</a></li><li><a href="Request.html">Request</a></li><li><a href="ResetDatabase.html">ResetDatabase</a></li><li><a href="ResponseError.html">ResponseError</a></li><li><a href="SearchItems.html">SearchItems</a></li><li><a href="SetItemValues.html">SetItemValues</a></li><li><a href="SetUserValues.html">SetUserValues</a></li><li><a href="SetValues.html">SetValues</a></li><li><a href="SetViewPortion.html">SetViewPortion</a></li><li><a href="TimeoutError.html">TimeoutError</a></li><li><a href="UpdateMoreItems.html">UpdateMoreItems</a></li></ul>
244
- </nav>
245
-
246
- <br class="clear">
247
-
248
- <footer>
249
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Apr 25 2022 16:02:57 GMT+0200 (Central European Summer Time)
250
- </footer>
251
-
252
- <script> prettyPrint(); </script>
253
- <script src="scripts/linenumber.js"> </script>
254
- </body>
255
- </html>