recombee_api_client 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/recombee_api_client/api/add_bookmark.rb +1 -1
  3. data/lib/recombee_api_client/api/add_cart_addition.rb +3 -3
  4. data/lib/recombee_api_client/api/add_detail_view.rb +1 -1
  5. data/lib/recombee_api_client/api/add_group.rb +1 -1
  6. data/lib/recombee_api_client/api/add_item.rb +2 -2
  7. data/lib/recombee_api_client/api/add_item_property.rb +1 -1
  8. data/lib/recombee_api_client/api/add_manual_reql_segment.rb +69 -0
  9. data/lib/recombee_api_client/api/add_purchase.rb +4 -4
  10. data/lib/recombee_api_client/api/add_rating.rb +1 -1
  11. data/lib/recombee_api_client/api/add_series.rb +1 -1
  12. data/lib/recombee_api_client/api/add_user_property.rb +2 -2
  13. data/lib/recombee_api_client/api/create_auto_reql_segmentation.rb +75 -0
  14. data/lib/recombee_api_client/api/create_manual_reql_segmentation.rb +71 -0
  15. data/lib/recombee_api_client/api/create_property_based_segmentation.rb +76 -0
  16. data/lib/recombee_api_client/api/delete_bookmark.rb +3 -3
  17. data/lib/recombee_api_client/api/delete_cart_addition.rb +3 -3
  18. data/lib/recombee_api_client/api/delete_detail_view.rb +3 -3
  19. data/lib/recombee_api_client/api/delete_group.rb +2 -2
  20. data/lib/recombee_api_client/api/delete_item.rb +2 -2
  21. data/lib/recombee_api_client/api/delete_manual_reql_segment.rb +52 -0
  22. data/lib/recombee_api_client/api/delete_more_items.rb +3 -3
  23. data/lib/recombee_api_client/api/delete_purchase.rb +3 -3
  24. data/lib/recombee_api_client/api/delete_rating.rb +2 -2
  25. data/lib/recombee_api_client/api/delete_search_synonym.rb +1 -1
  26. data/lib/recombee_api_client/api/delete_segmentation.rb +50 -0
  27. data/lib/recombee_api_client/api/delete_series.rb +1 -1
  28. data/lib/recombee_api_client/api/delete_user.rb +1 -1
  29. data/lib/recombee_api_client/api/delete_user_property.rb +1 -1
  30. data/lib/recombee_api_client/api/get_item_values.rb +2 -2
  31. data/lib/recombee_api_client/api/get_segmentation.rb +50 -0
  32. data/lib/recombee_api_client/api/get_user_values.rb +2 -2
  33. data/lib/recombee_api_client/api/insert_to_group.rb +2 -2
  34. data/lib/recombee_api_client/api/insert_to_series.rb +2 -2
  35. data/lib/recombee_api_client/api/list_group_items.rb +1 -1
  36. data/lib/recombee_api_client/api/list_item_bookmarks.rb +2 -2
  37. data/lib/recombee_api_client/api/list_item_cart_additions.rb +2 -2
  38. data/lib/recombee_api_client/api/list_item_detail_views.rb +2 -2
  39. data/lib/recombee_api_client/api/list_item_purchases.rb +2 -2
  40. data/lib/recombee_api_client/api/list_item_ratings.rb +2 -2
  41. data/lib/recombee_api_client/api/list_item_view_portions.rb +2 -2
  42. data/lib/recombee_api_client/api/list_items.rb +1 -1
  43. data/lib/recombee_api_client/api/list_segmentations.rb +51 -0
  44. data/lib/recombee_api_client/api/list_series_items.rb +2 -2
  45. data/lib/recombee_api_client/api/list_user_bookmarks.rb +1 -1
  46. data/lib/recombee_api_client/api/list_user_cart_additions.rb +1 -1
  47. data/lib/recombee_api_client/api/list_user_detail_views.rb +1 -1
  48. data/lib/recombee_api_client/api/list_user_purchases.rb +1 -1
  49. data/lib/recombee_api_client/api/list_user_ratings.rb +1 -1
  50. data/lib/recombee_api_client/api/list_user_view_portions.rb +1 -1
  51. data/lib/recombee_api_client/api/list_users.rb +1 -1
  52. data/lib/recombee_api_client/api/merge_users.rb +2 -2
  53. data/lib/recombee_api_client/api/recommend_item_segments_to_item.rb +131 -0
  54. data/lib/recombee_api_client/api/recommend_item_segments_to_item_segment.rb +131 -0
  55. data/lib/recombee_api_client/api/recommend_item_segments_to_user.rb +111 -0
  56. data/lib/recombee_api_client/api/recommend_items_to_item.rb +26 -26
  57. data/lib/recombee_api_client/api/recommend_items_to_user.rb +23 -23
  58. data/lib/recombee_api_client/api/recommend_next_items.rb +2 -2
  59. data/lib/recombee_api_client/api/recommend_users_to_item.rb +18 -18
  60. data/lib/recombee_api_client/api/recommend_users_to_user.rb +21 -21
  61. data/lib/recombee_api_client/api/reset_database.rb +1 -1
  62. data/lib/recombee_api_client/api/search_item_segments.rb +114 -0
  63. data/lib/recombee_api_client/api/search_items.rb +17 -17
  64. data/lib/recombee_api_client/api/set_view_portion.rb +3 -3
  65. data/lib/recombee_api_client/api/update_auto_reql_segmentation.rb +69 -0
  66. data/lib/recombee_api_client/api/update_manual_reql_segment.rb +67 -0
  67. data/lib/recombee_api_client/api/update_manual_reql_segmentation.rb +65 -0
  68. data/lib/recombee_api_client/api/update_more_items.rb +3 -3
  69. data/lib/recombee_api_client/api/update_property_based_segmentation.rb +69 -0
  70. data/lib/recombee_api_client/version.rb +1 -1
  71. data/lib/recombee_api_client.rb +1 -1
  72. metadata +18 -2
@@ -0,0 +1,131 @@
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 Segments from a result Segmentation that are the most relevant to a particular Segment from a context Segmentation.
11
+ #
12
+ #Based on the used Segmentations, this endpoint can be used for example for:
13
+ #
14
+ # - Recommending the related brands to particular brand
15
+ # - Recommending the related brands to particular category
16
+ # - Recommending the related artists to a particular genre (assuming songs are the Items)
17
+ #
18
+ #You need to set the used context and result Segmentation the Admin UI in the Scenario settings prior to using this endpoint.
19
+ #
20
+ #The returned segments are sorted by relevance (first segment being the most relevant).
21
+ #
22
+ #It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
23
+ #
24
+ class RecommendItemSegmentsToItemSegment < ApiRequest
25
+ attr_reader :context_segment_id, :target_user_id, :count, :scenario, :cascade_create, :filter, :booster, :logic, :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 item segments to be recommended (N for the top-N recommendation).
51
+ #
52
+ #
53
+ # * *Optional arguments (given as hash optional)*
54
+ # - +scenario+ -> Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
55
+ #
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 the performance of each scenario in the Admin UI separately, so you can check how well each application performs.
57
+ #
58
+ #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.
59
+ #
60
+ # - +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.
61
+ #
62
+ # - +filter+ -> Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended segments based on the `segmentationId`.
63
+ #
64
+ # - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some segments based on the `segmentationId`.
65
+ #
66
+ # - +logic+ -> Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
67
+ #See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
68
+ #
69
+ #The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
70
+ #
71
+ #Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
72
+ #
73
+ # - +expertSettings+ -> Dictionary of custom options.
74
+ #
75
+ # - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
76
+ #
77
+ #
78
+ def initialize(context_segment_id, target_user_id, count, optional = {})
79
+ @context_segment_id = context_segment_id
80
+ @target_user_id = target_user_id
81
+ @count = count
82
+ optional = normalize_optional(optional)
83
+ @scenario = optional['scenario']
84
+ @cascade_create = optional['cascadeCreate']
85
+ @filter = optional['filter']
86
+ @booster = optional['booster']
87
+ @logic = optional['logic']
88
+ @expert_settings = optional['expertSettings']
89
+ @return_ab_group = optional['returnAbGroup']
90
+ @optional = optional
91
+ @timeout = 3000
92
+ @ensure_https = false
93
+ @optional.each do |par, _|
94
+ fail UnknownOptionalParameter.new(par) unless ["scenario","cascadeCreate","filter","booster","logic","expertSettings","returnAbGroup"].include? par
95
+ end
96
+ end
97
+
98
+ # HTTP method
99
+ def method
100
+ :post
101
+ end
102
+
103
+ # Values of body parameters as a Hash
104
+ def body_parameters
105
+ p = Hash.new
106
+ p['contextSegmentId'] = @context_segment_id
107
+ p['targetUserId'] = @target_user_id
108
+ p['count'] = @count
109
+ p['scenario'] = @optional['scenario'] if @optional.include? 'scenario'
110
+ p['cascadeCreate'] = @optional['cascadeCreate'] if @optional.include? 'cascadeCreate'
111
+ p['filter'] = @optional['filter'] if @optional.include? 'filter'
112
+ p['booster'] = @optional['booster'] if @optional.include? 'booster'
113
+ p['logic'] = @optional['logic'] if @optional.include? 'logic'
114
+ p['expertSettings'] = @optional['expertSettings'] if @optional.include? 'expertSettings'
115
+ p['returnAbGroup'] = @optional['returnAbGroup'] if @optional.include? 'returnAbGroup'
116
+ p
117
+ end
118
+
119
+ # Values of query parameters as a Hash.
120
+ # name of parameter => value of the parameter
121
+ def query_parameters
122
+ params = {}
123
+ params
124
+ end
125
+
126
+ # Relative path to the endpoint
127
+ def path
128
+ "/{databaseId}/recomms/item-segments/item-segments/"
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,111 @@
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 the top Segments from a Segmentation for a particular user, based on the user's past interactions.
11
+ #
12
+ #Based on the used Segmentation, this endpoint can be used for example for:
13
+ #
14
+ # - Recommending the top categories for the user
15
+ # - Recommending the top genres for the user
16
+ # - Recommending the top brands for the user
17
+ # - Recommending the top artists for the user
18
+ #
19
+ #You need to set the used Segmentation the Admin UI in the Scenario settings prior to using this endpoint.
20
+ #
21
+ #The returned segments are sorted by relevance (first segment being the most relevant).
22
+ #
23
+ #It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
24
+ #
25
+ class RecommendItemSegmentsToUser < ApiRequest
26
+ attr_reader :user_id, :count, :scenario, :cascade_create, :filter, :booster, :logic, :expert_settings, :return_ab_group
27
+ attr_accessor :timeout
28
+ attr_accessor :ensure_https
29
+
30
+ ##
31
+ # * *Required arguments*
32
+ # - +user_id+ -> ID of the user for whom personalized recommendations are to be generated.
33
+ # - +count+ -> Number of item segments to be recommended (N for the top-N recommendation).
34
+ #
35
+ #
36
+ # * *Optional arguments (given as hash optional)*
37
+ # - +scenario+ -> Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
38
+ #
39
+ #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.
40
+ #
41
+ #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.
42
+ #
43
+ # - +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.
44
+ #
45
+ # - +filter+ -> Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended segments based on the `segmentationId`.
46
+ #
47
+ # - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some segments based on the `segmentationId`.
48
+ #
49
+ # - +logic+ -> Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
50
+ #See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
51
+ #
52
+ #The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
53
+ #
54
+ #Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
55
+ #
56
+ # - +expertSettings+ -> Dictionary of custom options.
57
+ #
58
+ # - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
59
+ #
60
+ #
61
+ def initialize(user_id, count, optional = {})
62
+ @user_id = user_id
63
+ @count = count
64
+ optional = normalize_optional(optional)
65
+ @scenario = optional['scenario']
66
+ @cascade_create = optional['cascadeCreate']
67
+ @filter = optional['filter']
68
+ @booster = optional['booster']
69
+ @logic = optional['logic']
70
+ @expert_settings = optional['expertSettings']
71
+ @return_ab_group = optional['returnAbGroup']
72
+ @optional = optional
73
+ @timeout = 3000
74
+ @ensure_https = false
75
+ @optional.each do |par, _|
76
+ fail UnknownOptionalParameter.new(par) unless ["scenario","cascadeCreate","filter","booster","logic","expertSettings","returnAbGroup"].include? par
77
+ end
78
+ end
79
+
80
+ # HTTP method
81
+ def method
82
+ :post
83
+ end
84
+
85
+ # Values of body parameters as a Hash
86
+ def body_parameters
87
+ p = Hash.new
88
+ p['count'] = @count
89
+ p['scenario'] = @optional['scenario'] if @optional.include? 'scenario'
90
+ p['cascadeCreate'] = @optional['cascadeCreate'] if @optional.include? 'cascadeCreate'
91
+ p['filter'] = @optional['filter'] if @optional.include? 'filter'
92
+ p['booster'] = @optional['booster'] if @optional.include? 'booster'
93
+ p['logic'] = @optional['logic'] if @optional.include? 'logic'
94
+ p['expertSettings'] = @optional['expertSettings'] if @optional.include? 'expertSettings'
95
+ p['returnAbGroup'] = @optional['returnAbGroup'] if @optional.include? 'returnAbGroup'
96
+ p
97
+ end
98
+
99
+ # Values of query parameters as a Hash.
100
+ # name of parameter => value of the parameter
101
+ def query_parameters
102
+ params = {}
103
+ params
104
+ end
105
+
106
+ # Relative path to the endpoint
107
+ def path
108
+ "/{databaseId}/recomms/users/#{@user_id}/item-segments/"
109
+ end
110
+ end
111
+ end
@@ -7,16 +7,16 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #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.
10
+ #Recommends a set of items that are somehow related to one given item, *X*. A typical scenario is when the user *A* is viewing *X*. Then you may display items to the user that he might also be interested in. Recommend items to item request gives you Top-N such items, optionally taking the target user *A* into account.
11
11
  #
12
- #The returned items are sorted by relevance (first item being the most relevant).
12
+ #The returned items are sorted by relevance (the first item being the most relevant).
13
13
  #
14
14
  #Besides the recommended items, also a unique `recommId` is returned in the response. It can be used to:
15
15
  #
16
- #- 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).
16
+ #- 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).
17
17
  #- 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).
18
18
  #
19
- #It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
19
+ #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.
20
20
  #
21
21
  class RecommendItemsToItem < ApiRequest
22
22
  attr_reader :item_id, :target_user_id, :count, :scenario, :cascade_create, :return_properties, :included_properties, :filter, :booster, :logic, :user_impact, :diversity, :min_relevance, :rotation_rate, :rotation_time, :expert_settings, :return_ab_group
@@ -34,27 +34,27 @@ module RecombeeApiClient
34
34
  #* Allows the calculation of Actions and Conversions
35
35
  # in the graphical user interface,
36
36
  # as Recombee can pair the user who got recommendations
37
- # and who afterwards viewed/purchased an item.
37
+ # and who afterward viewed/purchased an item.
38
38
  #
39
39
  #If you insist on not specifying the user, pass `null`
40
- #(`None`, `nil`, `NULL` etc. depending on language) to *targetUserId*.
40
+ #(`None`, `nil`, `NULL` etc., depending on the language) to *targetUserId*.
41
41
  #Do not create some special dummy user for getting recommendations,
42
42
  #as it could mislead the recommendation models,
43
43
  #and result in wrong recommendations.
44
44
  #
45
- #For anonymous/unregistered users it is possible to use for example their session ID.
45
+ #For anonymous/unregistered users, it is possible to use, for example, their session ID.
46
46
  #
47
47
  # - +count+ -> Number of items to be recommended (N for the top-N recommendation).
48
48
  #
49
49
  # * *Optional arguments (given as hash optional)*
50
- # - +scenario+ -> Scenario defines a particular application of recommendations. It can be for example "homepage", "cart" or "emailing".
50
+ # - +scenario+ -> Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
51
51
  #
52
- #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.
52
+ #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.
53
53
  #
54
- #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.
54
+ #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.
55
55
  #
56
- # - +cascadeCreate+ -> 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.
57
- # - +returnProperties+ -> With `returnProperties=true`, property values of the recommended items are returned along with their IDs in a JSON dictionary. The acquired property values can be used for easy displaying of the recommended items to the user.
56
+ # - +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.
57
+ # - +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.
58
58
  #
59
59
  #Example response:
60
60
  #```
@@ -85,7 +85,7 @@ module RecombeeApiClient
85
85
  # }
86
86
  #```
87
87
  #
88
- # - +includedProperties+ -> Allows to specify, which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
88
+ # - +includedProperties+ -> Allows specifying which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
89
89
  #
90
90
  #Example response for `includedProperties=description,price`:
91
91
  #```
@@ -112,34 +112,34 @@ module RecombeeApiClient
112
112
  # }
113
113
  #```
114
114
  #
115
- # - +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.
115
+ # - +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.
116
116
  #
117
- #Filters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
117
+ #Filters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
118
118
  #
119
- # - +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.
119
+ # - +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.
120
120
  #
121
- #Boosters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
121
+ #Boosters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
122
122
  #
123
- # - +logic+ -> Logic specifies particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
124
- #See [this section](https://docs.recombee.com/recommendation_logics.html) for list of available logics and other details.
123
+ # - +logic+ -> Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
124
+ #See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
125
125
  #
126
126
  #The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
127
127
  #
128
- #Logic can be also set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
128
+ #Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
129
129
  #
130
- # - +userImpact+ -> **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`.
130
+ # - +userImpact+ -> **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 a user-based recommendation. The default value is `0`.
131
131
  #
132
- # - +diversity+ -> **Expert option** Real number from [0.0, 1.0] which determines how much mutually dissimilar should the recommended items be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
132
+ # - +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.
133
133
  #
134
- # - +minRelevance+ -> **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.
134
+ # - +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.
135
135
  #
136
- # - +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 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
+ # - +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.
137
137
  #
138
- # - +rotationTime+ -> **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.
138
+ # - +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.
139
139
  #
140
140
  # - +expertSettings+ -> Dictionary of custom options.
141
141
  #
142
- # - +returnAbGroup+ -> If there is a custom AB-testing running, return name of group to which the request belongs.
142
+ # - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
143
143
  #
144
144
  #
145
145
  def initialize(item_id, target_user_id, count, optional = {})
@@ -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 a given user.
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 at homepage, in some "Picked just for you" section or in email.
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. user clicked one of the recommended items). See [Reported metrics](https://docs.recombee.com/admin_ui.html#reported-metrics).
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 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.
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 for easy displaying of the recommended items to the user.
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 to specify, which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
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 also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
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 also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
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 also set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
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 much mutually dissimilar should the recommended items be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
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 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.
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-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`.
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 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`.
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 a next page.
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. request from the first page) and number of items that shall be returned (`count`).
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
- #Recommend users that are likely to be interested in a given item.
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 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.
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 for easy displaying the recommended users.
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 to specify, which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
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 also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
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 also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
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 also set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
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 much mutually dissimilar should the recommended items be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
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 = {})