Code Monkey home page Code Monkey logo

behavior2vec's Introduction

behavior2vec

This package implements the Behavior2Vec algorithm introduced in the following paper. Please cite the paper if you find this package useful.

Chen, Hung-Hsuan. "Behavior2Vec: Generating Distributed Representations of Users’ Behaviors on Products for Recommender Systems." ACM Transactions on Knowledge Discovery from Data (TKDD) 12.4 (2018).

BibTeX:

@article{chen2018behavior2vec,
    title={Behavior2Vec: Generating Distributed Representations of Users’ Behaviors on Products for Recommender Systems},
    author={Chen, Hung-Hsuan},
    journal={ACM Transactions on Knowledge Discovery from Data (TKDD)},
    volume={12},
    issue={4},
    year={2018},
    publisher={ACM}
}

Paper download:

Sample usage (with caution):

>>> import behavior2vec
>>> model = behavior2vec.Behavior2Vec()
>>> model.train('./data/sample_data.txt')  # log file, one line per user (session)
>>> model.most_similar_behavior('v-100', 'p', k=5)  # predict most similar p-type (purchasing) behavior to 'v-100' (view item 100)
>>> model.most_similar_item('100', k=5) # predict most similar items to item 100

How to install:

python setup.py install

Command line tools:

After installation, you may run the following scripts directly (tested in Ubuntu 16.04 and OS X El Capitan).

To generate the Behavior2Vec model, run:

b2v-train.py [train-file]

This will generate a model file of the name [train-file]-b2v-model.pck under the same directory.

To show the most similar behavior, run:

b2v-most-similar-behavior.py [test-file] [model-file] [output-file] [k] [behavior-type]

The [test-file] contains a list of query behaviors, one behavior per line.

The [output-file] is the output file, which contains a list of the top [k] most simiar behaviors

To show the most similar items, run:

b2v-most-similar-item.py [test-file] [model-file] [output-file] [k]

The [test-file] contains a list of query items, one behavior per line. The [output-file] is the output file, which contains a list of the top [k] most simiar items

behavior2vec's People

Contributors

hhchen1105 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.