Giter Site home page Giter Site logo

zekarias-tilahun / cas2vec Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 3.0 8.14 MB

Tensorflow Implementation of the cas2vec algorithm as described in the paper, "Network-Agnostic Cascade Prediction in Online Social Networks"

License: MIT License

Python 100.00%
cascade-classifier convolutional-neural-networks social-network-analysis deep-learning

cas2vec's Introduction

Cas2Vec

Implementation of the Cas2Vec algorithm as described in the paper, Network-Agnostic Cascade Prediction in Online Social Networks. In this paper we investigate how one can effectively do virality prediction without requiring knowledge of the underlying nework. The complete detail is given in our paper. The source code contains minor changes for some terms used in the paper and we have included an inline documentation for such changes. Eg. slices are named as bins.

Requirements!

  • Tensorflow 1.5+
  • Numpy

Usage

Example usage

$ python cas2vec/main.py --cas-path data/train.txt

Input format

Each Line is assoiated with a cascade id followed by a sequence of infection events separated by white space. An infection event contains a pair (node_id,timestamp), timestamp should be relative and in seconds. That is, the timestamp of the first event is 0, and for the rest the time stamps are simply the difference (in seconds) between the current event the previous event. For example:

1 1000,0 47,890 2,1000, 700,3808, 475,20070

2 3290,0 9798,10 90,15, 98,16, 987,20

Possible Parameters

--cas-path: A path to cascade file. Default is empty string.

--model-dir: A path to a directory to save a trained model. Default is ./models

--obs-time: An observation time. Default is 1 hour

--prd-time: A Prediction time (it should be greater than --obs-time, i.e. --obs-time + delta, delta > 0). Default is 16 hours

--time-unit: The time unit used to specify the previous two parameters (possible values are, h for hour, m for minute, and s for second). Default is 'h'

--disc-method: The discretization method to be used possible values are (counter, const). Default is counter.

--num-bins: The number of bins (slices). Default is 40

--seq-len: Sequence length, relevant when the --disc-method is 'const'. Default is 100

--threshold: A virality threshold. Default is 1000

--dev-ratio: The fraction of points to be used as a development set. Default is 0.2. Set it to 0 during test.

--kernel-size: A list of kerne sizes to be used in the Convolutional Layer. Default is empty, but internally it will be set to -- [3, 4]

--filters: A list of numbers associated with the number of filters for each kernel size in the above argument. Default is empty, but internally it will be set to -- [32, 16].

--fcc-layers:. A list containing the configuration for the Fully Connected Layer, which comes after the Convolutional Layer and before the Prediction Layer. Default is empty, but internally it is set to -- [512, 128].

--size: The embedding size related to the Cascade Embedding Matrix. Default is 128.

--lr: Learning rate. Default is 0.0001

--batch-size:. Batch size. Default is 32

--epochs: Number of epochs. Default is 10

--sf: Sampling factor used to control the number of non-viral cascades. Default is 1. The number of non-vrial cascades is proportional to the number of viral cascades by a factor --sf

Citing

If you find Cas2Vec useful in your research, we kindly ask that you cite the following paper:

@INPROCEEDINGS{8554730,
author={Zekraias T. Kefato and N. Sheikh and L. Bahri and A. Soliman and A. Montresor and S. Girdzijauskas},
booktitle={2018 Fifth International Conference on Social Networks Analysis, Management and Security (SNAMS)},
title={CAS2VEC: Network-Agnostic Cascade Prediction in Online Social Networks},
year={2018},
publisher = {IEEE},
pages={72-79},
keywords={Cascade Prediction, Convolutional Neural Networks, Deep Learning, Social Networks},
doi={10.1109/SNAMS.2018.8554730},
month={Oct},}

cas2vec's People

Contributors

zekarias-tilahun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cas2vec's Issues

Data format

Hi, I generated a data set with the format you suggested, but it seems not working. Could you upload a sample data file with the format you use? Great thanks.

test_data

Hello, I noticed that you did not include the test evaluation in your code. Would this have a significant impact on the results?

Thanks for your time.
Best wishes

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.