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
Recommendation System to recommend top books from the dataset

recommendersystem Recommendation System to recommend top books from the dataset Introduction The recom.py is the main program code. The dataset is als

Vishal karur 1 Nov 15, 2021
Persine is an automated tool to study and reverse-engineer algorithmic recommendation systems.

Persine, the Persona Engine Persine is an automated tool to study and reverse-engineer algorithmic recommendation systems. It has a simple interface a

Jonathan Soma 87 Nov 29, 2022
Recommender System Papers

Included Conferences: SIGIR 2020, SIGKDD 2020, RecSys 2020, CIKM 2020, AAAI 2021, WSDM 2021, WWW 2021

RUCAIBox 704 Jan 06, 2023
[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
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
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
Books Recommendation With Python

Books-Recommendation Business Problem During the last few decades, with the rise

Çağrı Karadeniz 7 Mar 12, 2022
Movie Recommender System

Movie-Recommender-System Movie-Recommender-System is a web application using which a user can select his/her watched movie from list and system will r

1 Jul 14, 2022
A framework for large scale recommendation algorithms.

A framework for large scale recommendation algorithms.

Alibaba Group - PAI 880 Jan 03, 2023
It is a movie recommender web application which is developed using the Python.

Movie Recommendation 🍿 System Watch Tutorial for this project Source IMDB Movie 5000 Dataset Inspired from this original repository. Features Simple

Kushal Bhavsar 10 Dec 26, 2022
Code for KHGT model, AAAI2021

KHGT Code for KHGT accepted by AAAI2021 Please unzip the data files in Datasets/ first. To run KHGT on Yelp data, use python labcode_yelp.py For Movi

32 Nov 29, 2022
Recommendation Systems for IBM Watson Studio platform

Recommendation-Systems-for-IBM-Watson-Studio-platform Project Overview In this project, I analyze the interactions that users have with articles on th

Milad Sadat-Mohammadi 1 Jan 21, 2022
A movie recommender which recommends the movies belonging to the genre that user has liked the most.

Content-Based-Movie-Recommender-System This model relies on the similarity of the items being recommended. (I have used Pandas and Numpy. However othe

Srinivasan K 0 Mar 31, 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
Movies/TV Recommender

recommender Movies/TV Recommender. Recommends Movies, TV Shows, Actors, Directors, Writers. Setup Create file API_KEY and paste your TMDB API key in i

Aviem Zur 3 Apr 22, 2022
Elliot is a comprehensive recommendation framework that analyzes the recommendation problem from the researcher's perspective.

Comprehensive and Rigorous Framework for Reproducible Recommender Systems Evaluation

Information Systems Lab @ Polytechnic University of Bari 215 Nov 29, 2022
The official implementation of "DGCN: Diversified Recommendation with Graph Convolutional Networks" (WWW '21)

DGCN This is the official implementation of our WWW'21 paper: Yu Zheng, Chen Gao, Liang Chen, Depeng Jin, Yong Li, DGCN: Diversified Recommendation wi

FIB LAB, Tsinghua University 37 Dec 18, 2022
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
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
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