-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathconfig.toml
More file actions
183 lines (125 loc) · 5.36 KB
/
config.toml
File metadata and controls
183 lines (125 loc) · 5.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
[master]
# GRPC port of the master node. The default value is 8086.
port = 8086
# gRPC host of the master node. The default values is "0.0.0.0".
host = "0.0.0.0"
# HTTP port of the master node. The default values is 8088.
http_port = 8088
# HTTP host of the master node. The default values is "0.0.0.0".
http_host = "0.0.0.0"
# Number of working jobs in the master node. The default value is 1.
n_jobs = 1
# Meta information timeout. The default value is 10s.
meta_timeout = "10s"
# Username for the master node dashboard.
dashboard_user_name = ""
# Password for the master node dashboard.
dashboard_password = ""
[server]
# Default number of returned items. The default value is 10.
default_n = 10
# Secret key for RESTful APIs (SSL required).
api_key = ""
# Clock error in the cluster. The default value is 5s.
clock_error = "5s"
# Insert new users while inserting feedback. The default value is true.
auto_insert_user = true
# Insert new items while inserting feedback. The default value is true.
auto_insert_item = false
[recommend]
# The cache size for recommended/popular/latest items. The default value is 10.
cache_size = 100
# Recommended cache expire time. The default value is 72h.
cache_expire = "72h"
# The context size for online recommendations. Online recommendations can't use all user feedbacks to generate
# recommendations for efficiency consideration. Instead, only the latest `context_size` feedbacks are used.
# The default value is 100.
context_size = 100
# The time-to-live (days) of active users, 0 means disabled. Recommendation won't be cached for inactive users. The default value is 0.
active_user_ttl = 0
[recommend.data_source]
# The feedback types for positive events.
positive_feedback_types = ["star","like","read>=3"]
# The feedback types for read events.
read_feedback_types = ["read"]
# The time-to-live (days) of positive feedback, 0 means disabled. The default value is 0.
positive_feedback_ttl = 0
# The time-to-live (days) of items, 0 means disabled. The default value is 0.
item_ttl = 0
[[recommend.non-personalized]]
# The name of the leaderboard.
name = "most_starred_weekly"
# The score function for items in the leaderboard.
score = "count(feedback, .FeedbackType == 'star')"
# The filter for items in the leaderboard.
filter = "(now() - item.Timestamp).Hours() < 168"
[[recommend.item-to-item]]
# The name of the item-to-item recommender.
name = "neighbors"
# The type of the item-to-item recommender. There are three types:
# embedding: recommend by Euclidean distance of embeddings.
# tags: recommend by number of common tags.
# users: recommend by number of common users.
type = "embedding"
# The column of the item embeddings. Leave blank if type is "users".
column = "item.Labels.embedding"
[[recommend.user-to-user]]
# The name of the user-to-user recommender.
name = "neighbors"
# The type of the user-to-user recommender. There are three types:
# embedding: recommend by Euclidean distance of embeddings.
# tags: recommend by number of common tags.
# items: recommend by number of common items.
type = "items"
[[recommend.external]]
# The name of the external recommender.
name = "trending"
# The script to fetch external recommended items. The script should return a list of item IDs.
script = """
const response = fetch("https://cdn.jsdelivr.net/gh/isboyjc/github-trending-api/data/daily/all.json");
if (!response.ok) {
throw new Error(`${response.status} ${response.body}`);
}
const data = JSON.parse(response.body);
data["items"].map((item) => {
return item["title"].toLowerCase().replace("/", ":");
})
"""
[recommend.collaborative]
# The type of collaborative filtering. Supported values:
# none: disable collaborative filtering.
# mf: matrix factorization.
type = "mf"
# The time period for model fitting. The default value is "60m".
fit_period = "60m"
# The number of epochs for model fitting. The default value is 100.
fit_epoch = 100
[recommend.collaborative.early_stopping]
# Number of epochs to wait if no improvement and then stop the training. The default value is 10.
patience = 10
[recommend.replacement]
# Replace historical items back to recommendations. The default value is false.
enable_replacement = false
# Decay the weights of replaced items from positive feedbacks. The default value is 0.8.
positive_replacement_decay = 0.8
# Decay the weights of replaced items from read feedbacks. The default value is 0.6.
read_replacement_decay = 0.6
[recommend.ranker]
# The type of the ranker. There are two types:
# none: no ranking (default).
# fm: factorization machines.
type = "fm"
# The time period to refresh recommendation for inactive users. The default values is 120h.
cache_expire = "120h"
# The recommenders used to fetch candidate items before ranking. The default values is all recommenders.
recommenders = ["latest", "collaborative", "non-personalized/most_starred_weekly", "item-to-item/neighbors", "user-to-user/neighbors"]
# The time period for model fitting. The default value is "60m".
fit_period = "60m"
# The number of epochs for model fitting. The default value is 100.
fit_epoch = 100
[recommend.ranker.early_stopping]
# Number of epochs to wait if no improvement and then stop the training. The default value is 10.
patience = 10
[recommend.fallback]
# The fallback recommenders are used when cached recommendation drained out. The default values is ["latest"].
recommenders = ["item-to-item/neighbors", "latest"]