Group-Buying Recommendation for Social E-Commerce

Overview

Group-Buying Recommendation for Social E-Commerce

This is the official implementation of the paper Group-Buying Recommendation for Social E-Commerce (PDF) accepted by ICDE'2021.

Group-Buying Dataset

Group buying, as an emerging form of purchase in social e-commerce websites, such as Pinduoduo.com , has recently achieved great success. In this new business model, users, initiator, can launch a group and share products to their social networks, and when there are enough friends, participants, join it, the deal is clinched. Group-buying recommendation for social ecommerce, which recommends an item list when users want to launch a group, plays an important role in the group success ratio and sales.

The information about the dataset can be found in BeiBei/readme.txt.

Code

We separate model definition from the framework librecframework for easily understanding.

You can find the framework librecframework in https://github.com/Sweetnow/librecframework.

Both modules mentioned in requirements.txt and librecframework should be installed before running the code.

More details about our codes will be added soon.

Usage

  1. Download both librecframework and this repo
git clone [email protected]:Sweetnow/librecframework.git
git clone [email protected]:Sweetnow/group-buying-recommendation.git
  1. Install librecframework (Python >= 3.8)
cd librecframework/
bash install.sh
  1. Install dgl

  2. Download negative.zip from Release, unzip it and copy *.negative.txt to datasets/BeiBei/

wget https://github.com/Sweetnow/group-buying-recommendation/releases/download/v1.0/negative.zip
unzip negative.zip
cp negative/* ${PATH-TO-GROUP-BUYING-RECOMMENDATION}/datasets/BeiBei

PS: negative sampling file is used for testing. More details can be found in Datasets README

  1. Set config/config.json and config/pretrain.json following Docs.

  2. Run the following command to know the CLI and check python environment:

python3 GBGCN train -h
# or
# python3 GBGCN test -h

PS: If you set hyperparameters that support multi input to multi values, the framework will automatically do grid-search accroding to your input. That is, use the Cartesian product of the hyperparameters for training and testing. For example, set --lr 0.1 0.01 -L 1 2, the codes will train and test model with hyperparameters [(0.1, 1), (0.1, 2), (0.01, 1), (0.01, 2)].

Citation

If you want to use our codes or dataset in your research, please cite:

@inproceedings{zhang2021group,
  title={Group-Buying Recommendation for Social E-Commerce},
  author={Zhang, Jun and Gao, Chen and Jin, Depeng and Li, Yong},
  booktitle={2021 IEEE 37th International Conference on Data Engineering (ICDE)},
  year={2021},
  organization={IEEE}
}

Acknowledgement

Comments
  • About Testing

    About Testing

    Hi,

    Since I always fail to run the testing mode (for both GBMF and GBGCN) due to lack of "model.json", I'm wondering how to save a pretrained (GBMF) model as a json file and how to run the testing mode. Thanks.

    opened by vincenttsai2015 16
  • About negative samples for testing

    About negative samples for testing

    Hi,

    After resolving the issues of testing execution, I'm wondering if the following error is due to the lack of test.negative.txt.

    image

    If so, how can I generate negative samples? Thanks.

    opened by vincenttsai2015 14
  • It was killed before the training process started when the code was reproduced

    It was killed before the training process started when the code was reproduced

    hello,I want to know what the computer configuration should be to successfully reproduce these jobs. I can't reproduce it on 2080ti with 11gb of memory, and it's useless when I try to make the batchsize small enough. Or can you specify the hyperparameter setting?

    opened by ZQSong1997 6
  • Implementing the GBGCN in google colab

    Implementing the GBGCN in google colab

    Hi, After installing setup.py file from the mentioned frame work in the GitHub, I tried to run the GBGCN.py file by this command in Google Colab, "! python GBGCN.py train --tag 'true' --SL2 0.001 --L2 0.001 --lr 1e-2 --layer 2 --alpha 0.6 --beta 0.01 ". The below Errors showed: ( Any help to solve these errors and run the file properly would be appreciated! Just to mentioned that when I tried to run the whole data on GBGCN.py, it was not successful. I think the not enough RAM on colab was the problem( my colab RAM is around 12 GB) so I tried to reduce the size of BeiBei data set( 0.01 of the data set) to tackle this issue. Then these errors showed)

    INFO:root:Environment Arguments(OrderedDict([('dataset', 'BeiBei'), ('device', [0]), ('sample_epoch', 500), ('sample_worker', 16), ('epoch', 500), ('tag', 'true')])) INFO:root:Dataloader Arguments(OrderedDict([('batch_size', 4096), ('batch_worker', 2), ('test_batch_size', 128), ('test_batch_worker', 2)])) INFO:root:Hyperparameter Arguments(OrderedDict([('embedding_size', 32), ('act', 'sigmoid'), ('pretrain', True), ('SL2', [0.001]), ('L2', [0.001]), ('lr', [0.01]), ('layer', [2]), ('alpha', [0.6]), ('beta', [0.01])])) INFO:root:{'comment': '固定参数', 'user': 'user', 'visdom': {'server': '127.0.0.1', 'port': {'BeiBei_itemrec': 16670, 'BeiBei_grouprec': 16670, 'BeiBei_SIGR': 16670, 'BeiBei': 16670, 'comment': '16671 is temporary'}}, 'training': {'test_interval': 5, 'early_stop': 50, 'overfit': {'protected_epoch': 10, 'threshold': 1}}, 'dataset': {'path': './BeiBei', 'seed': 123, 'use_backup': True}, 'logger': {'path': './log', 'policy': 'best'}, 'metric': {'target': {'type': 'NDCG', 'topk': 10}, 'metrics': [{'type': 'Recall', 'topk': 3}, {'type': 'Recall', 'topk': 5}, {'type': 'Recall', 'topk': 10}, {'type': 'Recall', 'topk': 20}, {'type': 'NDCG', 'topk': 3}, {'type': 'NDCG', 'topk': 5}, {'type': 'NDCG', 'topk': 10}, {'type': 'NDCG', 'topk': 20}]}} INFO:root:{'BeiBei': {'GBMF': ''}} DEBUG:root:Load BeiBei/BeiBei/BeiBei-neg-500-123-default.pkl DEBUG:root:finish loading neg sample INFO:root:GPU search space: [0] INFO:root:Auto select GPU 0 WARNING:visdom:Setting up a new session... Exception in user code:

    Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 159, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw) File "/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py", line 80, in create_connection raise err File "/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py", line 70, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 354, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.7/http/client.py", line 1277, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1323, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1272, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1032, in _send_output self.send(msg) File "/usr/lib/python3.7/http/client.py", line 972, in send self.connect() File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 181, in connect conn = self._new_conn() File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 168, in _new_conn self, "Failed to establish a new connection: %s" % e) urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fd8435d5c50>: Failed to establish a new connection: [Errno 111] Connection refused

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 638, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/local/lib/python3.7/dist-packages/urllib3/util/retry.py", line 399, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=16670): Max retries exceeded with url: /env/GBGCN_true-32-0.01-0.001-0.001-2-0.6-0.01-sigmoid-True-True (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd8435d5c50>: Failed to establish a new connection: [Errno 111] Connection refused'))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/visdom/init.py", line 711, in _send data=json.dumps(msg), File "/usr/local/lib/python3.7/dist-packages/visdom/init.py", line 677, in _handle_post r = self.session.post(url, data=data) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 578, in post return self.request('POST', url, data=data, json=json, **kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 530, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 643, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=16670): Max retries exceeded with url: /env/GBGCN_true-32-0.01-0.001-0.001-2-0.6-0.01-sigmoid-True-True (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd8435d5c50>: Failed to establish a new connection: [Errno 111] Connection refused')) INFO:visdom:Socket refused connection, running socketless ERROR:visdom:[Errno 111] Connection refused ERROR:websocket:error from callback <function Visdom.setup_socket..on_close at 0x7fd84346ec20>: on_close() takes 1 positional argument but 3 were given File "/usr/local/lib/python3.7/dist-packages/websocket/_app.py", line 407, in _callback callback(self, *args) Traceback (most recent call last): File "GBGCN.py", line 556, in torch.optim.SGD) File "/usr/local/lib/python3.7/dist-packages/librecframework-1.3.0-py3.7.egg/librecframework/pipeline.py", line 633, in during_running model_class, other_args, trainhooks, optim_type) File "/usr/local/lib/python3.7/dist-packages/librecframework-1.3.0-py3.7.egg/librecframework/pipeline.py", line 239, in during_running model.load_pretrain(self._pretrain[self._eam['dataset']]) File "GBGCN.py", line 102, in load_pretrain pretrain = torch.load(path, map_location='cpu') File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 381, in load f = open(f, 'rb') FileNotFoundError: [Errno 2] No such file or directory: ''

    opened by Ali-khn 5
  • About ranking metric evaluation

    About ranking metric evaluation

    Hi,

    I'm wondering if it is possible to evaluate the ranking metrics of MAP(mean average precision) @ K and HR(hit ratio) @ K of GBMF/GBGCN under librecframework. If yes, how can I modify the code? Thanks.

    opened by vincenttsai2015 2
  • 您好,我在复现您的代码时遇到以下问题,想请教一下。

    您好,我在复现您的代码时遇到以下问题,想请教一下。

    命令: python GBGCN.py train [-h] 错误: Using backend: pytorch usage: GBGCN.py train [-h] [-DS DATASET] [-D DEVICE [DEVICE ...]] -T TAG [-SEP SAMPLE_EPOCH] [-SW SAMPLE_WORKER] [-EP EPOCH] [-BS BATCH_SIZE] [-BW BATCH_WORKER] [-TBS TEST_BATCH_SIZE] [-TBW TEST_BATCH_WORKER] [-EB EMBEDDING_SIZE] [--lr LR [LR ...]] --L2 L2 [L2 ...] --SL2 SL2 [SL2 ...] -L LAYER [LAYER ...] -A ALPHA [ALPHA ...] -B BETA [BETA ...] [--act ACT] [--pretrain | --no-pretrain] GBGCN.py train: error: the following arguments are required: -T/--tag, --L2, --SL2, -L/--layer, -A/--alpha, -B/--beta

    opened by Ganoder 2
  • Negative sample files

    Negative sample files

    Hi, My question is how to use negative sample file in order to run the whole model correctly? should I copy the file in BeiBei folder? Can I run the model correctly without "negative sample file"? Any instruction from scratch would be of any help. Thanks

    opened by Ali-khn 2
  • TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

    TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

    作者您好,我安装了requirements.txt和librecframework之后运行GBGCN.py,遇到了以下错误: Traceback (most recent call last): File "GBGCN.py", line 14, in from librecframework.argument.manager import HyperparamManager File "C:\Users\ZSX\AppData\Roaming\Python\Python36\site-packages\librecframework\argument_init_.py", line 11, in class Argument(NamedTuple, Generic[T]): TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

    请问这是什么情况呢

    opened by zanshuxun 2
Owner
Jun Zhang
EE, Tsinghua University
Jun Zhang
6002project-rl - An implemention of offline RL on recommender system

An implemention of offline RL on recommender system @author: misajie @update: 20

Tzay Lee 3 May 24, 2022
This is our Tensorflow implementation for "Graph-based Embedding Smoothing for Sequential Recommendation" (GES) (TKDE, 2021).

Graph-based Embedding Smoothing (GES) This is our Tensorflow implementation for the paper: Tianyu Zhu, Leilei Sun, and Guoqing Chen. "Graph-based Embe

Tianyu Zhu 15 Nov 29, 2022
Group-Buying Recommendation for Social E-Commerce

Group-Buying Recommendation for Social E-Commerce This is the official implementation of the paper Group-Buying Recommendation for Social E-Commerce (

Jun Zhang 37 Nov 28, 2022
A tensorflow implementation of the RecoGCN model in a CIKM'19 paper, titled with "Relation-Aware Graph Convolutional Networks for Agent-Initiated Social E-Commerce Recommendation".

This repo contains a tensorflow implementation of RecoGCN and the experiment dataset Running the RecoGCN model python train.py Example training outp

xfl15 30 Nov 25, 2022
Cross Domain Recommendation via Bi-directional Transfer Graph Collaborative Filtering Networks

Bi-TGCF Tensorflow Implementation of BiTGCF: Cross Domain Recommendation via Bi-directional Transfer Graph Collaborative Filtering Networks. in CIKM20

17 Nov 30, 2022
Use Jupyter Notebooks to demonstrate how to build a Recommender with Apache Spark & Elasticsearch

Recommendation engines are one of the most well known, widely used and highest value use cases for applying machine learning. Despite this, while there are many resources available for the basics of

International Business Machines 793 Dec 18, 2022
Code for MB-GMN, SIGIR 2021

MB-GMN Code for MB-GMN, SIGIR 2021 For Beibei data, run python .\labcode.py For Tmall data, run python .\labcode.py --data tmall --rank 2 For IJCAI

32 Dec 04, 2022
Hierarchical Fashion Graph Network for Personalized Outfit Recommendation, SIGIR 2020

hierarchical_fashion_graph_network This is our Tensorflow implementation for the paper: Xingchen Li, Xiang Wang, Xiangnan He, Long Chen, Jun Xiao, and

LI Xingchen 70 Dec 05, 2022
EXEMPLO DE SISTEMA ESPECIALISTA PARA RECOMENDAR SERIADOS EM PYTHON

exemplo-de-sistema-especialista EXEMPLO DE SISTEMA ESPECIALISTA PARA RECOMENDAR SERIADOS EM PYTHON Resumo O objetivo de auxiliar o usuário na escolha

Josue Lopes 3 Aug 31, 2021
Price-aware Recommendation with Graph Convolutional Networks,

PUP This is the official implementation of our ICDE'20 paper: Yu Zheng, Chen Gao, Xiangnan He, Yong Li, Depeng Jin, Price-aware Recommendation with Gr

S4rawBer2y 3 Oct 30, 2022
An open source movie recommendation WebApp build by movie buffs and mathematicians that uses cosine similarity on the backend.

Movie Pundit Find your next flick by asking the (almost) all-knowing Movie Pundit Jump to Project Source » View Demo · Report Bug · Request Feature Ta

Kapil Pramod Deshmukh 8 May 28, 2022
Real time recommendation playground

concierge A continuous learning collaborative filter1 deployed with a light web server2. Distributed updates are live (real time pubsub + delta traini

Mark Essel 16 Nov 07, 2022
Spark-movie-lens - An on-line movie recommender using Spark, Python Flask, and the MovieLens dataset

A scalable on-line movie recommender using Spark and Flask This Apache Spark tutorial will guide you step-by-step into how to use the MovieLens datase

Jose A Dianes 794 Dec 23, 2022
QRec: A Python Framework for quick implementation of recommender systems (TensorFlow Based)

QRec is a Python framework for recommender systems (Supported by Python 3.7.4 and Tensorflow 1.14+) in which a number of influential and newly state-of-the-art recommendation models are implemented.

Yu 1.4k Dec 27, 2022
RecSim NG: Toward Principled Uncertainty Modeling for Recommender Ecosystems

RecSim NG, a probabilistic platform for multi-agent recommender systems simulation. RecSimNG is a scalable, modular, differentiable simulator implemented in Edward2 and TensorFlow. It offers: a power

Google Research 110 Dec 16, 2022
Respiratory Health Recommendation System

Respiratory-Health-Recommendation-System Respiratory Health Recommendation System based on Air Quality Index Forecasts This project aims to provide pr

Abhishek Gawabde 1 Jan 29, 2022
A library of Recommender Systems

A library of Recommender Systems This repository provides a summary of our research on Recommender Systems. It includes our code base on different rec

MilaGraph 980 Jan 05, 2023
基于个性化推荐的音乐播放系统

MusicPlayer 基于个性化推荐的音乐播放系统 Hi, 这是我在大四的时候做的毕设,现如今将该项目开源。 本项目是基于Python的tkinter和pygame所著。 该项目总体来说,代码比较烂(因为当时水平很菜)。 运行的话安装几个基本库就能跑,只不过里面的数据还没有上传至Github。 先

Cedric Niu 6 Nov 19, 2022
This is our implementation of GHCF: Graph Heterogeneous Collaborative Filtering (AAAI 2021)

GHCF This is our implementation of the paper: Chong Chen, Weizhi Ma, Min Zhang, Zhaowei Wang, Xiuqiang He, Chenyang Wang, Yiqun Liu and Shaoping Ma. 2

Chong Chen 53 Dec 05, 2022
Dual Graph Attention Networks for Deep Latent Representation of Multifaceted Social Effects in Recommender Systems

DANSER-WWW-19 This repository holds the codes for Dual Graph Attention Networks for Deep Latent Representation of Multifaceted Social Effects in Recom

Qitian Wu 78 Dec 10, 2022