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
Code for my ORSUM, ACM RecSys 2020, HeroGRAPH: A Heterogeneous Graph Framework for Multi-Target Cross-Domain Recommendation

HeroGRAPH Code for my ORSUM @ RecSys 2020, HeroGRAPH: A Heterogeneous Graph Framework for Multi-Target Cross-Domain Recommendation Paper, workshop pro

Qiang Cui 9 Sep 14, 2022
Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk

Annoy Annoy (Approximate Nearest Neighbors Oh Yeah) is a C++ library with Python bindings to search for points in space that are close to a given quer

Spotify 10.6k Jan 01, 2023
Codes for CIKM'21 paper 'Self-Supervised Graph Co-Training for Session-based Recommendation'.

COTREC Codes for CIKM'21 paper 'Self-Supervised Graph Co-Training for Session-based Recommendation'. Requirements: Python 3.7, Pytorch 1.6.0 Best Hype

Xin Xia 43 Jan 04, 2023
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
A Library for Field-aware Factorization Machines

Table of Contents ================= - What is LIBFFM - Overfitting and Early Stopping - Installation - Data Format - Command Line Usage - Examples -

1.6k 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
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
Accuracy-Diversity Trade-off in Recommender Systems via Graph Convolutions

Accuracy-Diversity Trade-off in Recommender Systems via Graph Convolutions This repository contains the code of the paper "Accuracy-Diversity Trade-of

2 Sep 16, 2022
Recommender systems are the systems that are designed to recommend things to the user based on many different factors

Recommender systems are the systems that are designed to recommend things to the user based on many different factors. The recommender system deals with a large volume of information present by filte

Happy N. Monday 3 Feb 15, 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
Global Context Enhanced Social Recommendation with Hierarchical Graph Neural Networks

SR-HGNN ICDM-2020 《Global Context Enhanced Social Recommendation with Hierarchical Graph Neural Networks》 Environments python 3.8 pytorch-1.6 DGL 0.5.

xhc 9 Nov 12, 2022
Code for ICML2019 Paper "Compositional Invariance Constraints for Graph Embeddings"

Dependencies NOTE: This code has been updated, if you were using this repo earlier and experienced issues that was due to an outaded codebase. Please

Avishek (Joey) Bose 43 Nov 25, 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
[ICDMW 2020] Code and dataset for "DGTN: Dual-channel Graph Transition Network for Session-based Recommendation"

DGTN: Dual-channel Graph Transition Network for Session-based Recommendation This repository contains PyTorch Implementation of ICDMW 2020 (NeuRec @ I

Yujia 25 Nov 17, 2022
This library intends to be a reference for recommendation engines in Python

Crab - A Python Library for Recommendation Engines

Marcel Caraciolo 85 Oct 04, 2021
Implementation of a hadoop based movie recommendation system

Implementation-of-a-hadoop-based-movie-recommendation-system 通过编写代码,设计一个基于Hadoop的电影推荐系统,通过此推荐系统的编写,掌握在Hadoop平台上的文件操作,数据处理的技能。windows 10 hadoop 2.8.3 p

汝聪(Ricardo) 5 Oct 02, 2022
Fast Python Collaborative Filtering for Implicit Feedback Datasets

Implicit Fast Python Collaborative Filtering for Implicit Datasets. This project provides fast Python implementations of several different popular rec

Ben Frederickson 3k Dec 31, 2022
Bundle Graph Convolutional Network

Bundle Graph Convolutional Network This is our Pytorch implementation for the paper: Jianxin Chang, Chen Gao, Xiangnan He, Depeng Jin and Yong Li. Bun

55 Dec 25, 2022
Attentive Social Recommendation: Towards User And Item Diversities

ASR This is a Tensorflow implementation of the paper: Attentive Social Recommendation: Towards User And Item Diversities Preprint, https://arxiv.org/a

Dongsheng Luo 1 Nov 14, 2021
A recommendation system for suggesting new books given similar books.

Book Recommendation System A recommendation system for suggesting new books given similar books. Datasets Dataset Kaggle Dataset Notebooks goodreads-E

Sam Partee 2 Jan 06, 2022