psi-score


Namepsi-score JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/NouamaneA/psi-score
SummaryMetric of user influence in Online Social Networks
upload_time2023-04-18 15:16:59
maintainer
docs_urlNone
authorNouamane Arhachoui
requires_python>=3.9,<3.11
licenseMIT
keywords graph algorithms network science markov chain social networks pagerank
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Psi-score

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

## Requirements
* Python >=3.9,<3.11

## Installation

```bash
$ pip install psi-score
```

## Usage

```python
>>> 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:
```python
>>> 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):
```python
>>> 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. 
  2022 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM), 526-533. 
  https://doi.org/10.1109/ASONAM55673.2022.10068673

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/NouamaneA/psi-score",
    "name": "psi-score",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<3.11",
    "maintainer_email": "",
    "keywords": "graph algorithms,network science,markov chain,social networks,pagerank",
    "author": "Nouamane Arhachoui",
    "author_email": "nouamane.arhachoui@lip6.fr",
    "download_url": "https://files.pythonhosted.org/packages/19/e2/7487fc0f2428f9daa114864682d78736bc70304a0061dd3f4d960a4499ef/psi_score-1.0.0.tar.gz",
    "platform": null,
    "description": "# Psi-score\n\n$\\psi$-score: Metric of user influence in Online Social Networks\n\n## Requirements\n* Python >=3.9,<3.11\n\n## Installation\n\n```bash\n$ pip install psi-score\n```\n\n## Usage\n\n```python\n>>> from psi_score import PsiScore\n>>> adjacency = {0: [1, 3], 1: [0, 2], 2: [0, 1, 3], 3: [0]}\n>>> lambdas = [0.23, 0.50, 0.86, 0.19]\n>>> mus = [0.42, 0.17, 0.10, 0.37]\n>>> psiscore = PsiScore()\n>>> scores = psiscore.fit_transform(adjacency, lambdas, mus)\n>>> scores\narray([0.21158803, 0.35253745, 0.28798439, 0.14789014])\n>>> np.round(scores, 2)\narray([0.21, 0.35, 0.29, 0.15])\n```\nYou can use another algorithm and change some parameters:\n```python\n>>> psiscore = PsiScore(solver='power_nf', n_iter=500, tol=1e-3)\n>>> scores = psiscore.fit_transform(adjacency, lambdas, mus, ps=[1], qs=[0, 3])\n```\nThe ``ps`` and ``qs`` parameters allows to have some chosen ``p_i`` and ``q_i`` vectors (only with the ``push`` and ``power_nf`` methods):\n```python\n>>> psiscore.P\n{1: array([0.5333334 , 0.1681094 , 0.46801851, 0.34442264])}\n>>> psiscore.Q\n{0: array([0.46164044, 0.0514935 , 0.02798624, 0.30484491]),\n 3: array([0.13087053, 0.01616898, 0.01850541, 0.42554885])}\n```\n\n## License\n\n`psi-score` was created by Nouamane Arhachoui. It is licensed under the terms of the MIT license.\n\n## References\n\n* Giovanidis, A., Baynat, B., Magnien, C., & Vendeville, A. (2021).\n  Ranking Online Social Users by Their Influence. \n  IEEE/ACM Transactions on Networking, 29(5), 2198-2214. https://doi.org/10.1109/tnet.2021.3085201\n\n* Arhachoui, N., Bautista, E., Danisch, M., & Giovanidis, A. (2022). \n  A Fast Algorithm for Ranking Users by their Influence in Online Social Platforms. \n  2022 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM), 526-533. \n  https://doi.org/10.1109/ASONAM55673.2022.10068673\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Metric of user influence in Online Social Networks",
    "version": "1.0.0",
    "split_keywords": [
        "graph algorithms",
        "network science",
        "markov chain",
        "social networks",
        "pagerank"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3e7c4663cde288d542e3bc4ac50efbed3a84038eb1d1489ca0cd2944ab6b340b",
                "md5": "b1f06ea7a0de1ca996cc4ab77f7247bb",
                "sha256": "8976f6bf915b2f4d429a7f977dff45a7bc4ba19c6a64941598ea8e5c00a703eb"
            },
            "downloads": -1,
            "filename": "psi_score-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b1f06ea7a0de1ca996cc4ab77f7247bb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<3.11",
            "size": 12785,
            "upload_time": "2023-04-18T15:16:58",
            "upload_time_iso_8601": "2023-04-18T15:16:58.069091Z",
            "url": "https://files.pythonhosted.org/packages/3e/7c/4663cde288d542e3bc4ac50efbed3a84038eb1d1489ca0cd2944ab6b340b/psi_score-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "19e27487fc0f2428f9daa114864682d78736bc70304a0061dd3f4d960a4499ef",
                "md5": "9d3474ba0be5f31c8975344ce2e87e05",
                "sha256": "c8991b213ad2d3e4537e28c20097d04eecfd1e5adc41e807fa9d3556e1c440be"
            },
            "downloads": -1,
            "filename": "psi_score-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9d3474ba0be5f31c8975344ce2e87e05",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<3.11",
            "size": 8302,
            "upload_time": "2023-04-18T15:16:59",
            "upload_time_iso_8601": "2023-04-18T15:16:59.816506Z",
            "url": "https://files.pythonhosted.org/packages/19/e2/7487fc0f2428f9daa114864682d78736bc70304a0061dd3f4d960a4499ef/psi_score-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-18 15:16:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "NouamaneA",
    "github_project": "psi-score",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "psi-score"
}
        
Elapsed time: 0.88268s