Skip to content

Algorithm to find influencer in multilayer network.

License

Notifications You must be signed in to change notification settings

nickprock/influencer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Influencer Centrality

The algorithm in this package is inspired about the paper "Detecting Topic Authoritative Social Media Users: a Multilayer Network Approach". In this paper, the authors propose a method capable to find influential users by exploiting the contents of the messages posted by them to express opinions on items, by modeling these contents with a three-layer network.

The full paper and other materials are avaible on ICAR-CNR website.

I try to develop an algorithm like SocialAU using JAX, PyTorch and NumPy for calculations between tensors.


social-network


Image Credits


Installation

Dependencies

* Python >= 3.8.5
* Numpy >= 1.20
* PyTorch >= 1.10.2

User Installation

  1. Clone or download .zip and unzip
  2. Using terminal go into the folder with setup.py
  3. Digit the following command
python setup.py install
  1. Try
import influencer
influencer.__version__

or

sudo apt install git

pip install git+https://github.com/nickprock/influencer.git

Citation

If you use my code in your research, please cite this project:

@misc{influencer-centrality,
  author =       {Nicola Procopio,
  title =        {Influencer Centrality},
  howpublished = {\url{https://github.com/nickprock/influencer}},
  year =         {2020}
}

and this paper:

@article{oro2017detecting,
  title={Detecting topic authoritative social media users: a multilayer network approach},
  author={Oro, Ermelinda and Pizzuti, Clara and Procopio, Nicola and Ruffolo, Massimo},
  journal={IEEE Transactions on Multimedia},
  volume={20},
  number={5},
  pages={1195--1208},
  year={2017},
  publisher={IEEE}
}

Other Functions

The package contains others centrality measure like:

Test

I tested the performance about JAX vs Numpy vs PyTorch on HITS algorithm here on Google Colab. Other tests are available in notebook directory.


exe_time


The focus on Numpy vs PyTorch


focus_on


Execution time in log10 scale.


focus_on


At the moment numpy work better than JAX but I may have made some mistakes (the reason could be this). PyTorch is the best implementation, in socialAU works fine up to 10^9 nodes, runtime broke down with a tensor of about 5B nodes. Numpy stops at 10^8 nodes.

Please report it in the issues.

The library allows you to use only numpy versions beacuse JAX is not avaible for Windows, but the script is into lazy_centrality.py

Links

Have Fun!

License

The code present in this project is licensed under the MIT License.

Licenza Creative Commons
Quest'opera è distribuita con Licenza Creative Commons Attribuzione 4.0 Internazionale.

About

Algorithm to find influencer in multilayer network.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published