Configuration

zhenghaozNovember 20, 2022About 5 min

Configuration

These configuration items without default values must be filled. It's highly recommended to create a new config file based on config.toml.templateopen in new window.

database

KeyTypeDefaultDescription
data_storestringDatabase for data storage, supports MySQL, PostgreSQL, ClickHouse and MongoDB.
cache_storestringDatabase for cache storage, supports MySQL, PostgreSQL, MongoDB and Redis.
table_prefixstringNaming prefix for tables (collections, keys) in databases.
cache_table_prefixstringNaming prefix for tables (collections, keys) in cache storage databases. If empty, table_prefix is used.
data_table_prefixstringNaming prefix for tables (collections, keys) in data storage databases. If empty, table_prefix is used.

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

master

KeyTypeDefaultDescription
hoststring"0.0.0.0"Master node listening host for gRPC service (metadata exchange) (Build Recommender)
portinteger8086Master node listening port for gRPC service (metadata exchange) (Build Recommender)
http_hoststring"0.0.0.0"Master node listening host for HTTP service (dashboard (Gorse Dashboard))
http_portinteger8088Master node listening port for HTTP service (dashboard (Gorse Dashboard))
n_jobsinteger1Number of working threads for the master node
meta_timeoutinteger10sMetadata timeout (Build Recommender)
dashboard_user_namestringUsername login dashboard (Gorse Dashboard)
dashboard_passwordstringPassword login dashboard (Gorse Dashboard)

server

KeyTypeDefaultDescription
default_ninteger10Default number of returned items (RESTful APIs)
api_keystringSecret key for RESTful APIs (SSL required) (RESTful APIs)
clock_errorinteger5sclock error in the cluster (RESTful APIs)
auto_insert_userbooleantrueAutomatically insert new users when inserting new feedback (Feedback Collection)
auto_insert_itembooleantrueAutomatically insert new items when inserting new feedback (Feedback Collection)
cache_expirestring10sServer-side cache expire time (RESTful APIs)

recommend

KeyTypeDefaultDescription
cache_sizestring100Number of cached elements in cache store
cache_expirestring72hRecommended cache expire time

recommend.data_source

KeyTypeDefaultDescription
positive_feedback_typesstringTypes of positive feedback (Feedback Collection)
read_feedback_typesstringType of feedback for read events (Feedback Collection)
positive_feedback_ttlstring0Time-to-live of positive feedback (Performance vs Precision)
item_ttlstring0Time-to-live of items (Performance vs Precision)
KeyTypeDefaultDescription
popular_windowinteger4320hTime window of popular items in days (Recommendation Strategies)

recommend.user_neighbors

KeyTypeDefaultDescription
neighbor_typestring"auto"The type of neighbors for users (Recommendation Strategies)
enable_indexbooleanfalseEnable approximate item neighbor searching using vector index (Performance vs Precision)
index_recallfloat0.8Minimal recall for approximate item neighbor searching (Performance vs Precision)
index_fit_epochinteger3Maximal number of fit epochs for approximate item neighbor searching vector index (Performance vs Precision)

recommend.item_neighbors

KeyTypeDefaultDescription
neighbor_typestring"auto"The type of neighbors for items (Recommendation Strategies)
enable_indexbooleanfalseEnable approximate item neighbor searching using vector index (Performance vs Precision)
index_recallfloat0.8Minimal recall for approximate user neighbor searching (Performance vs Precision)
index_fit_epochinteger3Maximal number of fit epochs for approximate user neighbor searching vector index (Performance vs Precision)

recommend.collaborative

KeyTypeDefaultDescription
model_fit_periodinteger60mPeriod of model training (Performance vs Precision)
model_search_periodinteger360mPeriod of model search (Performance vs Precision)
model_search_epochinteger100Number of training epochs for each model in model search (Performance vs Precision)
model_search_trialsinteger10Number of trials for each model in model search (Performance vs Precision)
enable_model_size_searchbooleanfalseEnable searching models of different sizes, which consume more memory.
enable_indexbooleanfalseEnable approximate collaborative filtering recommend using vector index (Performance vs Precision)
index_recallfloat0.9Minimal recall for approximate collaborative filtering recommend (Performance vs Precision)
index_fit_epochinteger3Maximal number of fit epochs for approximate collaborative filtering recommend vector index (Performance vs Precision)

recommend.replacement

KeyTypeDefaultDescription
enable_replacementbooleanfalseReplace historical items back to recommendations (Performance vs Precision)
positive_replacement_decayfloat0.8Decay the weights of replaced items from positive feedbacks (Performance vs Precision)
read_replacement_decayfloat0.6Decay the weights of replaced items from read feedbacks (Performance vs Precision)

recommend.offline

KeyTypeDefaultDescription
check_recommend_periodinteger1mPeriod to check recommendation for users (Performance vs Precision)
refresh_recommend_periodinteger24hPeriod to refresh offline recommendation cache (Performance vs Precision)
enable_latest_recommendbooleanfalseEnable latest recommendation during offline recommendation (Recommendation Strategies)
enable_popular_recommendbooleanfalseEnable popular recommendation during offline recommendation (Recommendation Strategies)
enable_user_based_recommendbooleanfalseEnable user-based similarity recommendation during offline recommendation (Recommendation Strategies)
enable_item_based_recommendbooleanfalseEnable item-based similarity recommendation during offline recommendation (Recommendation Strategies)
enable_collaborative_recommendbooleantrueEnable collaborative filtering recommendation during offline recommendation (Recommendation Strategies)
enable_click_through_predictionbooleanfalseEnable click-though rate prediction during offline recommendation. Otherwise, results from multi-way recommendation would be merged randomly (Recommendation Strategies)
explore_recommendmap{ popular = 0.0, latest = 0.0 }The explore recommendation method is used to inject popular items or latest items into recommended result (Recommendation Strategies)

recommend.online

KeyTypeDefaultDescription
fallback_recommendstrings["latest"]Source of recommendation when personalized recommendation exhausted (Recommendation Strategies)
num_feedback_fallback_item_basedinteger10The number of feedback used in fallback item-based similar recommendation (Recommendation Strategies)

Environment Variables

Part of configurations can be overwritten by environment variables.

ConfigurationEnvironment Variable
database.cache_storeGORSE_CACHE_STORE
database.data_storeGORSE_DATA_STORE
database.table_prefixGORSE_TABLE_PREFIX
database.cache_table_prefixGORSE_CACHE_TABLE_PREFIX
database.data_table_prefixGORSE_DATA_TABLE_PREFIX
master.portGORSE_MASTER_PORT
master.hostGORSE_MASTER_HOST
master.http_portGORSE_MASTER_HTTP_PORT
master.http_hostGORSE_MASTER_HTTP_HOST
master.n_jobsGORSE_MASTER_JOBS
master.dashboard_user_nameGORSE_DASHBOARD_USER_NAME
master.dashboard_passwordGORSE_DASHBOARD_PASSWORD
server.api_keyGORSE_SERVER_API_KEY
Loading...