Skip to main content

Metric of user influence in Online Social Networks

Project description

Psi-score

$\psi$-score: Metric of user influence in Online Social Networks

Requirements

  • Python >=3.9,<3.11

Installation

$ pip install psi-score

Usage

>>> from psi_score import PsiScore
>>> adjacency = {0: [1, 3], 1: [0, 2], 2: [0, 1, 3], 3: [0]}
>>> lambdas = [0.23, 0.50, 0.86, 0.19]
>>> mus = [0.42, 0.17, 0.10, 0.37]
>>> psiscore = PsiScore()
>>> scores = psiscore.fit_transform(adjacency, lambdas, mus)
>>> scores
array([0.21158803, 0.35253745, 0.28798439, 0.14789014])
>>> np.round(scores, 2)
array([0.21, 0.35, 0.29, 0.15])

You can use another algorithm and change some parameters:

>>> psiscore = PsiScore(solver='power_nf', n_iter=500, tol=1e-3)
>>> scores = psiscore.fit_transform(adjacency, lambdas, mus, ps=[1], qs=[0, 3])

The ps and qs parameters allows to have some chosen p_i and q_i vectors (only with the push and power_nf methods):

>>> psiscore.P
{1: array([0.5333334 , 0.1681094 , 0.46801851, 0.34442264])}
>>> psiscore.Q
{0: array([0.46164044, 0.0514935 , 0.02798624, 0.30484491]),
 3: array([0.13087053, 0.01616898, 0.01850541, 0.42554885])}

License

psi-score was created by Nouamane Arhachoui. It is licensed under the terms of the MIT license.

References

  • Giovanidis, A., Baynat, B., Magnien, C., & Vendeville, A. (2021). Ranking Online Social Users by Their Influence. IEEE/ACM Transactions on Networking, 29(5), 2198–2214. https://doi.org/10.1109/tnet.2021.3085201

  • Arhachoui, N., Bautista, E., Danisch, M., & Giovanidis, A. (2022). A Fast Algorithm for Ranking Users by their Influence in Online Social Platforms. arXiv Preprint. https://doi.org/10.48550/ARXIV.2206.09960

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

psi-score-0.2.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

psi_score-0.2.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file psi-score-0.2.0.tar.gz.

File metadata

  • Download URL: psi-score-0.2.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.12 Linux/5.18.11-200.fc36.x86_64

File hashes

Hashes for psi-score-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fc59029979e4c06ebf3cadea37484e1354fa2aaa6fdbf092965ebd004545d599
MD5 73a89cec52005a179c975beff9c64fa6
BLAKE2b-256 5bbd1ddc269e0768e783075b1fa5a6e7f71f7c1d6abedc488da050703e43f853

See more details on using hashes here.

File details

Details for the file psi_score-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: psi_score-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.12 Linux/5.18.11-200.fc36.x86_64

File hashes

Hashes for psi_score-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 243867e46c639d0d83443050eb31e81302452f2356a8857a5fce8856963a29f9
MD5 6ba577192986f14bf7493523d1f62159
BLAKE2b-256 e991c65f129bb800bbf7abdb40a4ad0bdf5dbebbd01b0fb4b36f41942b875a64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page