Giter Site home page Giter Site logo

cacf's Introduction

CACF

This is the Pytorch implementation for our CIKM 2021 short paper:

Jingsen Zhang, Xu Chen, and Wayne Xin Zhao (2021)."Causally Attentive Collaborative Filtering." In CIKM 2021.

Overview

We propose to equip attention mechanism with causal inference, which is a powerful tool to identify the real causal effects. Our model is based on the potential outcome framework. In specific, the real causal relation of each feature on the outcome is measured by the individual treatment effect (ITE) and we minimize the distance between the traditional attention weights and the normalized ITE. With such causal regularization, the learned attention weights can reflect the real causal effects.

Requirements

  • Python 3.7
  • Pytorch >=1.3

Notice: All the models are implemented based on RecBole, a popular open-source recommendation framework.

Datasets

We use three real-world benchmark datasets, including MovieLens-100K, Amazon-Electronics and Book-Crossing. All the datasets are available at this link.

Usage

  • Download the codes and datasets.
  • Run

Run run_cacf.py

python run_cacf.py --model=CACF --dataset=ml-100k --config_files='cacf.yaml ml-100k.yaml'

The meanings of parameters:

--model         model name: CACF, Pop, BPR, FM, WideDeep, AFM, DeepFM 
--dataset       dataset name: ml-100k, amazon_electronics, book_crossing
--config_files  the configuration files for model and dataset
  • Parameter Settings

The search ranges of some parameters are shown below. You can configure training parameters through the command line.

--learning_rate    [0.05, 0.01, 0.005, 0.001]
--embedding_size   [10, 16, 32, 64]
--train_batch_size [256, 512, 1024, 2048]
--mlp_hidden_size  [[32, 16, 8], [64, 32, 16], [128, 64, 32]]
--dropout_prob     [0.0, 0.05, 0.1, 0.2, 0.5]
--t                [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
--loss_weight1     [0.1, 0.5, 0.9]
--loss_weight2     [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]

Acknowledgement

Any scientific publications that use our codes and datasets should cite the following paper as the reference:

@inproceedings{Zhang-CIKM-2021,
    title = "Causally Attentive Collaborative Filtering",
    author = {Jingsen Zhang and
              Xu Chen and
              Wayne Xin Zhao},
    booktitle = {{CIKM}},
    year = {2021},
}

If you have any questions for our paper or codes, please send an email to [email protected].

cacf's People

Stargazers

Roman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.