recombee_api_client 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/recombee_api_client.rb +1 -1
- data/lib/recombee_api_client/api/add_bookmark.rb +1 -0
- data/lib/recombee_api_client/api/add_cart_addition.rb +1 -0
- data/lib/recombee_api_client/api/add_detail_view.rb +1 -0
- data/lib/recombee_api_client/api/add_purchase.rb +1 -0
- data/lib/recombee_api_client/api/add_rating.rb +1 -0
- data/lib/recombee_api_client/api/batch.rb +1 -0
- data/lib/recombee_api_client/api/delete_bookmark.rb +1 -0
- data/lib/recombee_api_client/api/delete_cart_addition.rb +1 -0
- data/lib/recombee_api_client/api/delete_detail_view.rb +1 -0
- data/lib/recombee_api_client/api/delete_purchase.rb +1 -0
- data/lib/recombee_api_client/api/delete_rating.rb +1 -0
- data/lib/recombee_api_client/api/delete_view_portion.rb +1 -0
- data/lib/recombee_api_client/api/hash_normalizer.rb +21 -0
- data/lib/recombee_api_client/api/insert_to_group.rb +1 -0
- data/lib/recombee_api_client/api/insert_to_series.rb +1 -0
- data/lib/recombee_api_client/api/item_based_recommendation.rb +3 -2
- data/lib/recombee_api_client/api/list_items.rb +1 -0
- data/lib/recombee_api_client/api/list_users.rb +1 -0
- data/lib/recombee_api_client/api/merge_users.rb +3 -2
- data/lib/recombee_api_client/api/recommend_items_to_item.rb +1 -0
- data/lib/recombee_api_client/api/recommend_items_to_user.rb +3 -2
- data/lib/recombee_api_client/api/recommend_users_to_item.rb +1 -0
- data/lib/recombee_api_client/api/recommend_users_to_user.rb +1 -0
- data/lib/recombee_api_client/api/request.rb +2 -0
- data/lib/recombee_api_client/api/set_values.rb +1 -0
- data/lib/recombee_api_client/api/set_view_portion.rb +3 -2
- data/lib/recombee_api_client/api/user_based_recommendation.rb +3 -2
- data/lib/recombee_api_client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72b624fc1cdb24d3afbff79cece22899d3ec16ca
|
4
|
+
data.tar.gz: b5ba19f5808607a614909bc3836144df57f74247
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 047f3f735420c34e159d4701149dcdb9df6b0b51d04761ec1c99c06b01a94383aa01576db73a9b37aa0f2618de9cae9051c9bcb7f17305adcc726cfa18895a90
|
7
|
+
data.tar.gz: c7bd8111794cc4f8c1fc21f58f74021a625fdad3998654b68b9bd8eea09b89497f2fd46c7c735b4b23efe17b60ef1c7f9f45a21ef9baef70ef76053fb95e92a4
|
data/lib/recombee_api_client.rb
CHANGED
@@ -18,7 +18,7 @@ module RecombeeApiClient
|
|
18
18
|
include HTTParty
|
19
19
|
|
20
20
|
BATCH_MAX_SIZE = 10000
|
21
|
-
USER_AGENT = {'User-Agent' => 'recombee-ruby-api-client/2.0.
|
21
|
+
USER_AGENT = {'User-Agent' => 'recombee-ruby-api-client/2.0.1'}
|
22
22
|
|
23
23
|
##
|
24
24
|
# - +account+ -> Name of your account at Recombee
|
@@ -26,6 +26,7 @@ module RecombeeApiClient
|
|
26
26
|
def initialize(user_id, item_id, optional = {})
|
27
27
|
@user_id = user_id
|
28
28
|
@item_id = item_id
|
29
|
+
optional = normalize_optional(optional)
|
29
30
|
@timestamp = optional['timestamp']
|
30
31
|
@cascade_create = optional['cascadeCreate']
|
31
32
|
@optional = optional
|
@@ -28,6 +28,7 @@ module RecombeeApiClient
|
|
28
28
|
def initialize(user_id, item_id, optional = {})
|
29
29
|
@user_id = user_id
|
30
30
|
@item_id = item_id
|
31
|
+
optional = normalize_optional(optional)
|
31
32
|
@timestamp = optional['timestamp']
|
32
33
|
@cascade_create = optional['cascadeCreate']
|
33
34
|
@amount = optional['amount']
|
@@ -27,6 +27,7 @@ module RecombeeApiClient
|
|
27
27
|
def initialize(user_id, item_id, optional = {})
|
28
28
|
@user_id = user_id
|
29
29
|
@item_id = item_id
|
30
|
+
optional = normalize_optional(optional)
|
30
31
|
@timestamp = optional['timestamp']
|
31
32
|
@duration = optional['duration']
|
32
33
|
@cascade_create = optional['cascadeCreate']
|
@@ -29,6 +29,7 @@ module RecombeeApiClient
|
|
29
29
|
def initialize(user_id, item_id, optional = {})
|
30
30
|
@user_id = user_id
|
31
31
|
@item_id = item_id
|
32
|
+
optional = normalize_optional(optional)
|
32
33
|
@timestamp = optional['timestamp']
|
33
34
|
@cascade_create = optional['cascadeCreate']
|
34
35
|
@amount = optional['amount']
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module RecombeeApiClient
|
2
|
+
##
|
3
|
+
# Module to convert Ruby conventions to Recombee's API namings
|
4
|
+
#
|
5
|
+
module HashNormalizer
|
6
|
+
def normalize_optional opts
|
7
|
+
opts_new = {}
|
8
|
+
opts.each do |k,v|
|
9
|
+
case k
|
10
|
+
when String then opts_new[camelize(k)] = opts.delete(k)
|
11
|
+
when Symbol then opts_new[camelize(k.to_s)] = opts.delete(k)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
opts_new
|
15
|
+
end
|
16
|
+
|
17
|
+
def camelize str
|
18
|
+
str.gsub(/_(.)/) {|e| $1.upcase}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -85,9 +85,9 @@ module RecombeeApiClient
|
|
85
85
|
#
|
86
86
|
# - +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 qualit, and may return less than *count* items when there is not enough data to fulfill it.
|
87
87
|
#
|
88
|
-
# - +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.
|
88
|
+
# - +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. Default: `0.01`.
|
89
89
|
#
|
90
|
-
# - +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.
|
90
|
+
# - +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. Default: `7200.0`.
|
91
91
|
#
|
92
92
|
# - +expertSettings+ -> Dictionary of custom options.
|
93
93
|
#
|
@@ -95,6 +95,7 @@ module RecombeeApiClient
|
|
95
95
|
def initialize(item_id, count, optional = {})
|
96
96
|
@item_id = item_id
|
97
97
|
@count = count
|
98
|
+
optional = normalize_optional(optional)
|
98
99
|
@target_user_id = optional['targetUserId']
|
99
100
|
@user_impact = optional['userImpact']
|
100
101
|
@filter = optional['filter']
|
@@ -19,8 +19,8 @@ module RecombeeApiClient
|
|
19
19
|
|
20
20
|
##
|
21
21
|
# * *Required arguments*
|
22
|
-
# - +target_user_id+ -> ID of the
|
23
|
-
# - +source_user_id+ -> ID of the
|
22
|
+
# - +target_user_id+ -> ID of the targer user.
|
23
|
+
# - +source_user_id+ -> ID of the source user.
|
24
24
|
#
|
25
25
|
# * *Optional arguments (given as hash optional)*
|
26
26
|
# - +cascadeCreate+ -> Sets whether the user *targetUserId* should be created if not present in the database.
|
@@ -28,6 +28,7 @@ module RecombeeApiClient
|
|
28
28
|
def initialize(target_user_id, source_user_id, optional = {})
|
29
29
|
@target_user_id = target_user_id
|
30
30
|
@source_user_id = source_user_id
|
31
|
+
optional = normalize_optional(optional)
|
31
32
|
@cascade_create = optional['cascadeCreate']
|
32
33
|
@optional = optional
|
33
34
|
@timeout = 10000
|
@@ -117,6 +117,7 @@ module RecombeeApiClient
|
|
117
117
|
@item_id = item_id
|
118
118
|
@target_user_id = target_user_id
|
119
119
|
@count = count
|
120
|
+
optional = normalize_optional(optional)
|
120
121
|
@user_impact = optional['userImpact']
|
121
122
|
@filter = optional['filter']
|
122
123
|
@booster = optional['booster']
|
@@ -86,9 +86,9 @@ module RecombeeApiClient
|
|
86
86
|
#
|
87
87
|
# - +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 relevancy, and may return less than *count* items when there is not enough data to fulfill it.
|
88
88
|
#
|
89
|
-
# - +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.
|
89
|
+
# - +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.1`.
|
90
90
|
#
|
91
|
-
# - +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.
|
91
|
+
# - +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`.
|
92
92
|
#
|
93
93
|
# - +expertSettings+ -> Dictionary of custom options.
|
94
94
|
#
|
@@ -96,6 +96,7 @@ module RecombeeApiClient
|
|
96
96
|
def initialize(user_id, count, optional = {})
|
97
97
|
@user_id = user_id
|
98
98
|
@count = count
|
99
|
+
optional = normalize_optional(optional)
|
99
100
|
@filter = optional['filter']
|
100
101
|
@booster = optional['booster']
|
101
102
|
@cascade_create = optional['cascadeCreate']
|
@@ -84,6 +84,7 @@ module RecombeeApiClient
|
|
84
84
|
def initialize(item_id, count, optional = {})
|
85
85
|
@item_id = item_id
|
86
86
|
@count = count
|
87
|
+
optional = normalize_optional(optional)
|
87
88
|
@filter = optional['filter']
|
88
89
|
@booster = optional['booster']
|
89
90
|
@cascade_create = optional['cascadeCreate']
|
@@ -90,6 +90,7 @@ module RecombeeApiClient
|
|
90
90
|
def initialize(user_id, count, optional = {})
|
91
91
|
@user_id = user_id
|
92
92
|
@count = count
|
93
|
+
optional = normalize_optional(optional)
|
93
94
|
@filter = optional['filter']
|
94
95
|
@booster = optional['booster']
|
95
96
|
@cascade_create = optional['cascadeCreate']
|
@@ -21,10 +21,10 @@ module RecombeeApiClient
|
|
21
21
|
# * *Required arguments*
|
22
22
|
# - +user_id+ -> User who viewed a portion of the item
|
23
23
|
# - +item_id+ -> Viewed item
|
24
|
-
# - +portion+ -> Viewed portion of the item (number between 0.0 (viewed nothing) and 1.0 (viewed full item) ).
|
24
|
+
# - +portion+ -> Viewed portion of the item (number between 0.0 (viewed nothing) and 1.0 (viewed full item) ). It should be the really viewed part of the item, no matter seeking, so for example if the user seeked immediately to half of the item and then viewed 10% of the item, the `portion` should still be `0.1`.
|
25
25
|
#
|
26
26
|
# * *Optional arguments (given as hash optional)*
|
27
|
-
# - +sessionId+ ->
|
27
|
+
# - +sessionId+ -> ID of session in which the user viewed the item. Default is `none`.
|
28
28
|
# - +timestamp+ -> UTC timestamp of the rating as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
|
29
29
|
# - +cascadeCreate+ -> Sets whether the given user/item should be created if not present in the database.
|
30
30
|
#
|
@@ -32,6 +32,7 @@ module RecombeeApiClient
|
|
32
32
|
@user_id = user_id
|
33
33
|
@item_id = item_id
|
34
34
|
@portion = portion
|
35
|
+
optional = normalize_optional(optional)
|
35
36
|
@session_id = optional['sessionId']
|
36
37
|
@timestamp = optional['timestamp']
|
37
38
|
@cascade_create = optional['cascadeCreate']
|
@@ -73,9 +73,9 @@ module RecombeeApiClient
|
|
73
73
|
#
|
74
74
|
# - +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 qualit, and may return less than *count* items when there is not enough data to fulfill it.
|
75
75
|
#
|
76
|
-
# - +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.
|
76
|
+
# - +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.1`.
|
77
77
|
#
|
78
|
-
# - +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.
|
78
|
+
# - +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`.
|
79
79
|
#
|
80
80
|
# - +expertSettings+ -> Dictionary of custom options.
|
81
81
|
#
|
@@ -83,6 +83,7 @@ module RecombeeApiClient
|
|
83
83
|
def initialize(user_id, count, optional = {})
|
84
84
|
@user_id = user_id
|
85
85
|
@count = count
|
86
|
+
optional = normalize_optional(optional)
|
86
87
|
@filter = optional['filter']
|
87
88
|
@booster = optional['booster']
|
88
89
|
@allow_nonexistent = optional['allowNonexistent']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recombee_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ondřej Fiedler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- lib/recombee_api_client/api/get_item_values.rb
|
121
121
|
- lib/recombee_api_client/api/get_user_property_info.rb
|
122
122
|
- lib/recombee_api_client/api/get_user_values.rb
|
123
|
+
- lib/recombee_api_client/api/hash_normalizer.rb
|
123
124
|
- lib/recombee_api_client/api/insert_to_group.rb
|
124
125
|
- lib/recombee_api_client/api/insert_to_series.rb
|
125
126
|
- lib/recombee_api_client/api/item_based_recommendation.rb
|