Configuration

Previous section Recommend using Gorse is helpful to understand configurations introduced in this section. These configuration items without default values must be filled. It's highly recommended to create new config file based on config.toml.template.

[database]

Configuratios under [database] are used to define behaviors on database and data.

KeyTypeDefaultDescription
data_storestringDatabase for data store (supports MySQL/MongoDB)
cache_storestringDatabase for cache store (supports Redis)
auto_insert_userbooleantrueAutomatically insert new users when inserting new feedback
auto_insert_itembooleantrueAutomatically insert new items when inserting new feedback
cache_sizestring100Number of cached elements in cache store
positive_feedback_typesstringTypes of positive feedback
click_feedback_typesstringTypes of feedback for click events
read_feedback_typestringType of feedback for read events
positive_feedback_ttlstring0Time-to-live of positive feedback
item_ttlstring0Time-to-live of items

The DSN (Database Source Name) format of the data_store and cache_store is as follows.

  • Redis: redis://hostname:port
  • MySQL: mysql://[username[:password]@][protocol[(hostname:port)]]/database[?config1=value1&...configN=valueN]
  • MongoDB: mongodb://[username:password@]hostname1[:port1][,... hostnameN[:portN]]][/[database][?options]]

[master]

Configuratios under [master] are used to define behaviors of the master node.

KeyTypeDefaultDescription
hoststring127.0.0.1Master node listening host for gRPC service (metadata exchange)
portinteger8086Master node listening port for gRPC service (metadata exchange)
http_hoststring127.0.0.1Master node listening host for HTTP service (dashboard)
http_portinteger8088Master node listening port for HTTP service (dashboard)
fit_jobsinteger1Number of working threads for model training
search_jobsinteger1Number of working threads for model search
meta_timeoutinteger60Metadata timeout in seconds

[server]

Configuratios under [server] are used to define behaviors of the server node.

KeyTypeDefaultDescription
default_ninteger10Default number of returned items
api_keystringSecret key for RESTful APIs (SSL required)

[recommend]

Configuratios under [recommend] are used to define behaviors of recommendation.

KeyTypeDefaultDescription
popular_windowinteger180Time window of popular items in days
fit_periodinteger60Period of model trainig in minutes
search_periodinteger180Period of model search in minutes
search_epochinteger100Number of training epoches for each model in model search
search_trialsinteger10Number of trials for each model in model search
refresh_recommend_periodinteger5Period to refresh offline recommendation cache in days
fallback_recommendintegerlatestSource of recommendation when personalized recommendation exhausted
explore_latest_numinteger10Number of latest items add to offline recommendation to address cold-start problem