0 valid positive
Gorse version
zhenghaoz/gorse-master:latest
Describe the bug
Status from the overview:
USERS
201,393
ITEMS
402
TOTAL POSITIVE
58,548
VALID POSITIVE
0
VALID NEGATIVE
0
Search click-through rate prediction model | Failed | 0000/12/31 20:06 | | No feedback found.
-- | -- | -- | -- | --
Fit collaborative filtering model | Failed | 0000/12/31 20:06 | | No feedback found.
Fit click-through rate prediction model | Failed | 0000/12/31 20:06 | | No feedback found.
Search collaborative filtering model | Failed | 0000/12/31 20:06 | | No feedback found.
positive feedback in config.toml
: positive_feedback_types = ["contact"]
I can see just item-related
recommendations
To Reproduce
config.yml:
# This section declares settings for the database.
[database]
# The database for caching, support Redis only:
# redis://<user>:<password>@<host>:<port>/<db_number>
cache_store = "redis://redis:6380"
# The database for persist data, support MySQL, Postgres, ClickHouse and MongoDB:
# mysql://[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...¶mN=valueN]
# postgres://bob:[email protected]:5432/mydb?sslmode=verify-full
# clickhouse://user:password@host[:port]/database?param1=value1&...¶mN=valueN
# mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
data_store = "mysql://gorse:gorse_pass@tcp(mysql:3306)/gorse?parseTime=true"
# The cache size for recommended/popular/latest items. The default value is 100.
cache_size = 200
# 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 = true
# The feedback types for positive events.
positive_feedback_types = ["contact"]
# 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
# This section declares settings for the master node.
[master]
port = 8086 # master port
host = "0.0.0.0" # master host
http_port = 8088 # HTTP API port
http_host = "0.0.0.0" # HTTP API host
n_jobs = 4 # number of working jobs
meta_timeout = 10 # cluster meta timeout (second)
# This section declares settings for the server node.
[server]
default_n = 20 # default number of returned items
api_key = "" # secret key for RESTful APIs (SSL required)
# This section declares settings for recommendation.
[recommend]
# The time window of popular items (days). The default values is 180.
popular_window = 30
# The time period for model fitting (minutes). The default values is 60.
fit_period = 10
# The time period for model searching (minutes). The default values is 100.
search_period = 60
# The number of epochs for model searching. The default values is 100.
search_epoch = 100
# The number of trials for model searching. The default values is 10.
search_trials = 10
# The time period to refresh recommendation for inactive users (days). The default values is 5.
refresh_recommend_period = 1
# The fallback recommendation method is used when cached recommendation drained out:
# item_based: Recommend similar items to cold-start users.
# popular: Recommend popular items to cold-start users.
# latest: Recommend latest items to cold-start users.
# Recommenders are used in order. The default values is ["latest"].
fallback_recommend = ["item_based", "latest"]
# The type of neighbors for items. There are three types:
# similar: Neighbors are found by number of common labels.
# related: Neighbors are found by number of common users.
# auto: If a item have labels, neighbors are found by number of common labels.
# If this item have no labels, neighbors are found by number of common users.
# The default values is "auto".
item_neighbor_type = "similar"
# The type of neighbors for users. There are three types:
# similar: Neighbors are found by number of common labels.
# related: Neighbors are found by number of common liked items.
# auto: If a user have labels, neighbors are found by number of common labels.
# If this user have no labels, neighbors are found by number of common liked items.
# The default values is "auto".
user_neighbor_type = "similar"
# Enable latest recommendation during offline recommendation. The default values is false.
enable_latest_recommend = true
# Enable popular recommendation during offline recommendation. The default values is false.
enable_popular_recommend = true
# Enable user-based similarity recommendation during offline recommendation. The default values is false.
enable_user_based_recommend = true
# Enable item-based similarity recommendation during offline recommendation. The default values is false.
enable_item_based_recommend = true
# Enable collaborative filtering recommendation during offline recommendation. The default values is true.
enable_collaborative_recommend = true
# Enable click-though rate prediction during offline recommendation. Otherwise, results from multi-way recommendation
# would be merged randomly. The default values is true.
enable_click_through_prediction = true
# The explore recommendation method is used to inject popular items or latest items into recommended result:
# popular: Recommend popular items to cold-start users.
# latest: Recommend latest items to cold-start users.
# Recommenders are used in order. The default values is { popular = 0.0, latest = 0.0 }.
explore_recommend = { popular = 0.1, latest = 0.2 }
docker-compose.yaml
version: "3"
services:
redis:
image: redis
restart: unless-stopped
ports:
- 6380:6380
mysql:
image: mysql/mysql-server
restart: unless-stopped
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: root_pass
MYSQL_DATABASE: gorse
MYSQL_USER: gorse
MYSQL_PASSWORD: gorse_pass
volumes:
- ./var/lib/mysql:/var/lib/mysql
worker:
image: zhenghaoz/gorse-worker
restart: unless-stopped
ports:
- 8089:8089
command: >
--master-host master --master-port 8086 --http-host 0.0.0.0 --http-port 8089
--log-path /var/log/gorse/worker.log --cache-path /var/lib/gorse/worker_cache.data
volumes:
- ./var/log/gorse:/var/log/gorse
- ./var/lib/gorse:/var/lib/gorse
server:
image: zhenghaoz/gorse-server
restart: unless-stopped
ports:
- 8087:8087
command: >
--master-host master --master-port 8086 --http-host 0.0.0.0 --http-port 8087
--log-path /var/log/gorse/server.log --cache-path /var/lib/gorse/server_cache.data
volumes:
- ./var/log/gorse:/var/log/gorse
- ./var/lib/gorse:/var/lib/gorse
master:
image: zhenghaoz/gorse-master
restart: unless-stopped
ports:
- 8086:8086
- 8088:8088
command: -c /etc/gorse/config.toml --log-path /var/log/gorse/master.log --cache-path /var/lib/gorse/master_cache.data
volumes:
- ./config.toml:/etc/gorse/config.toml
- ./var/log/gorse:/var/log/gorse
- ./var/lib/gorse:/var/lib/gorse
(simplified) data
feedback.sql
DROP TABLE IF EXISTS `feedback`;
CREATE TABLE `feedback` (
`feedback_type` varchar(256) NOT NULL,
`user_id` integer NOT NULL,
`item_id` integer NOT NULL,
`time_stamp` timestamp NOT NULL,
`comment` text NOT NULL,
PRIMARY KEY (`feedback_type`,`user_id`,`item_id`),
KEY `user_id` (`user_id`)
);
LOCK TABLES `feedback` WRITE;
INSERT INTO `feedback` VALUES
('contact', 9285, 2, '2013-01-21 18:47:08', ''),('contact', 9521, 2, '2013-04-22 14:21:10', ''),('contac
t', 12614, 2, '2013-04-22 14:21:10', ''),('contact', 39577, 2, '2013-04-01 18:47:47', ''),('contact', 42
083, 2, '2013-04-08 17:28:57', '');UNLOCK TABLES;
users.sql
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`user_id` integer NOT NULL,
`labels` json NOT NULL,
`comment` text NOT NULL,
`subscribe` json NOT NULL,
PRIMARY KEY (`user_id`)
) ;
LOCK TABLES `users` WRITE;
INSERT INTO `users` VALUES
(111830, '["Uruguay", "Montevideo", "Pocitos"]', '', '[]'),(113915, '["Uruguay", "Montevideo", "Pocitos"
]', '', '[]'),(119975, '["Uruguay", "Montevideo", "Pocitos"]', '', '[]'),(121938, '["Uruguay", "Montevid
eo", "Pocitos"]', '', '[]');UNLOCK TABLES;
items.sql
DROP TABLE IF EXISTS `items`;
CREATE TABLE `items` (
`item_id` integer NOT NULL,
`time_stamp` timestamp NOT NULL,
`labels` json NOT NULL,
`comment` text NOT NULL,
`is_hidden` tinyint(1) NOT NULL DEFAULT '0',
`categories` json NOT NULL,
PRIMARY KEY (`item_id`)
) ;
LOCK TABLES `items` WRITE;
INSERT INTO `items` VALUES
(1257, '2013-09-27 02:10:06', '["Uruguay", "Montevideo", "Pocitos"]', '', 0, '[]'),(2814, '2014-10-09 13
:26:37', '["amoblado", "amenities", "encargado", "portero", "vigilancia", "seguridad", "Argentina", "Bs.
As. G.B.A. Zona Norte", "Pilar", "La Lonja"]', '', 0, '[]');UNLOCK TABLES;
Expected behavior
recommendations
Additional context
logs
master.log
{"level":"info","ts":1638877759.9023194,"caller":"master/tasks.go:60","msg":"load dataset","positive_feedback_types":["contact"],"read_feedback_types":["read"],"item_ttl":0,"feedback_ttl":0,
"positive_feedback_types":["contact"]}
bug