rSpringRank


NamerSpringRank JSON
Version 0.2.28 PyPI version JSON
download
home_pagehttps://github.com/junipertcy/rSpringRank
SummaryRegularized methods for efficient ranking in networks
upload_time2024-06-29 00:28:18
maintainerNone
docs_urlNone
authorTzu-Chi Yen
requires_python!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,!=3.9.*,>=3.10
licenseLGPL-3.0-or-later
keywords network-analysis convex-optimization ranking-algorithm proximal-gradient-method denoising
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![license](https://img.shields.io/badge/license-LGPL-green.svg?style=flat)](https://github.com/junipertcy/rSpringRank/blob/main/LICENSE) [![PyPI version](https://img.shields.io/pypi/v/rSpringRank.svg)](https://pypi.org/project/rSpringRank/) [![PyPI downloads](https://img.shields.io/pypi/dm/rSpringRank.svg?label=Pypi%20downloads)](https://pypi.org/project/rSpringRank/) [![Build Status](https://github.com/junipertcy/rSpringRank/actions/workflows/release.yml/badge.svg)](https://github.com/junipertcy/rSpringRank/actions) [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)

**rSpringRank** implements a collection of regularized, convex models (+solvers) that allow the inference of hierarchical structure in a directed network, which exists due to dominance, social status, or prestige. Specifically, this work leverages the time-varying structure and/or the node metadata present in the data set.

This is the software repository behind the paper:

* Tzu-Chi Yen and Stephen Becker, *Regularized methods for efficient ranking in networks*, in preparation.
* For full documentation, please visit [this site](https://docs.netscied.tw/rSpringRank/index.html).
* General Q&A, ideas, or other things, please visit [Discussions](https://github.com/junipertcy/rSpringRank/discussions).
* Software-related bugs, issues, or suggestions, please use [Issues](https://github.com/junipertcy/rSpringRank/issues).

## Installation

**rSpringRank** is available on PyPI. It also depends on `graph-tool`. We recommend using `conda` to manage packages.

```bash
conda create --name rSpringRank-dev -c conda-forge graph-tool
conda activate rSpringRank-dev
pip install rSpringRank
```

## Example

```python
# Import the library
import rSpringRank as sr

# Load a data set
g = sr.datasets.us_air_traffic()

# Create a model
model = sr.optimize.rSpringRank(method="annotated")

# Fit the model: We decided to analyze the `state_abr` nodal metadata,
# We may inspect `g.list_properties()` for other metadata to analyze.
result = model.fit(g, alpha=1, lambd=0.5, goi="state_abr")

# Now, result["primal"] should have the rankings. We can compute a summary.
summary = sr.compute_summary(g, "state_abr", primal_s=result["primal"])
```

Let's plot the rankings, via `sr.plot_hist(summary)`. Note that most of the node catetories are regularized to have the same mean ranking.

![A histogram of four ranking groups, where most of the metadata share the same mean ranking.](docs/assets/us_air_traffic_hist.png)

We provided a summary via `sr.print_summary_table(summary)`.

      +-------+-------+--------+-----------------------------------------+--------+---------+
      | Group | #Tags | #Nodes | Members                                 |   Mean |     Std |
      +-------+-------+--------+-----------------------------------------+--------+---------+
      | 1     |     5 |    825 | CA, WA, OR, TT, AK                      |  0.047 | 1.1e-02 |
      | 2     |     4 |    206 | TX, MT, PA, ID                          | -0.006 | 4.2e-03 |
      | 3     |    43 |   1243 | MI, IN, TN, NC, VA, IL, CO, WV, MA, WI, | -0.035 | 4.3e-03 |
      |       |       |        | SC, KY, MO, MD, AZ, PR, LA, UT, MN, GA, |        |         |
      |       |       |        | MS, HI, DE, NM, ME, NJ, NE, VT, CT, SD, |        |         |
      |       |       |        | IA, NV, ND, AL, OK, AR, NH, RI, OH, FL, |        |         |
      |       |       |        | KS, NY, WY                              |        |         |
      | 4     |     1 |      4 | VI                                      | -0.072 | 0.0e+00 |
      +-------+-------+--------+-----------------------------------------+--------+---------+

The result suggests that states such as `CA`, `WA`, or `AK` are significantly more *popular* than other states.

## Data sets

We have a companion repo—[rSpringRank-data](https://github.com/junipertcy/rSpringRank-data)—for data sets used in the paper. Which are:

* [PhD_exchange](https://github.com/junipertcy/rSpringRank-data/tree/main/PhD_exchange)
* [Parakeet](https://github.com/junipertcy/rSpringRank-data/tree/main/parakeet)

In addendum, we have provided the [rSpringRank.datasets](https://junipertcy.github.io/rSpringRank/datasets.html) submodule to load data sets hosted by other repositories, such as the [Netzschleuder](http://networkrepository.com/). See the docs for more information.

## Development

The library uses pytest to ensure correctness. The test suite depends on [mosek](https://www.mosek.com/) and [gurobi](https://www.gurobi.com/).

## License

**rSpringRank** is open-source and licensed under the [GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html).


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/junipertcy/rSpringRank",
    "name": "rSpringRank",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,!=3.9.*,>=3.10",
    "maintainer_email": null,
    "keywords": "network-analysis, convex-optimization, ranking-algorithm, proximal-gradient-method, denoising",
    "author": "Tzu-Chi Yen",
    "author_email": "tzuchi.yen@colorado.edu",
    "download_url": "https://files.pythonhosted.org/packages/c8/86/38bf521c9d0767db16d52d1e0cbca7d7d8a90046eb2aa010e7af3ff448b6/rspringrank-0.2.28.tar.gz",
    "platform": null,
    "description": "[![license](https://img.shields.io/badge/license-LGPL-green.svg?style=flat)](https://github.com/junipertcy/rSpringRank/blob/main/LICENSE) [![PyPI version](https://img.shields.io/pypi/v/rSpringRank.svg)](https://pypi.org/project/rSpringRank/) [![PyPI downloads](https://img.shields.io/pypi/dm/rSpringRank.svg?label=Pypi%20downloads)](https://pypi.org/project/rSpringRank/) [![Build Status](https://github.com/junipertcy/rSpringRank/actions/workflows/release.yml/badge.svg)](https://github.com/junipertcy/rSpringRank/actions) [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)\n\n**rSpringRank** implements a collection of regularized, convex models (+solvers) that allow the inference of hierarchical structure in a directed network, which exists due to dominance, social status, or prestige. Specifically, this work leverages the time-varying structure and/or the node metadata present in the data set.\n\nThis is the software repository behind the paper:\n\n* Tzu-Chi Yen and Stephen Becker, *Regularized methods for efficient ranking in networks*, in preparation.\n* For full documentation, please visit [this site](https://docs.netscied.tw/rSpringRank/index.html).\n* General Q&A, ideas, or other things, please visit [Discussions](https://github.com/junipertcy/rSpringRank/discussions).\n* Software-related bugs, issues, or suggestions, please use [Issues](https://github.com/junipertcy/rSpringRank/issues).\n\n## Installation\n\n**rSpringRank** is available on PyPI. It also depends on `graph-tool`. We recommend using `conda` to manage packages.\n\n```bash\nconda create --name rSpringRank-dev -c conda-forge graph-tool\nconda activate rSpringRank-dev\npip install rSpringRank\n```\n\n## Example\n\n```python\n# Import the library\nimport rSpringRank as sr\n\n# Load a data set\ng = sr.datasets.us_air_traffic()\n\n# Create a model\nmodel = sr.optimize.rSpringRank(method=\"annotated\")\n\n# Fit the model: We decided to analyze the `state_abr` nodal metadata,\n# We may inspect `g.list_properties()` for other metadata to analyze.\nresult = model.fit(g, alpha=1, lambd=0.5, goi=\"state_abr\")\n\n# Now, result[\"primal\"] should have the rankings. We can compute a summary.\nsummary = sr.compute_summary(g, \"state_abr\", primal_s=result[\"primal\"])\n```\n\nLet's plot the rankings, via `sr.plot_hist(summary)`. Note that most of the node catetories are regularized to have the same mean ranking.\n\n![A histogram of four ranking groups, where most of the metadata share the same mean ranking.](docs/assets/us_air_traffic_hist.png)\n\nWe provided a summary via `sr.print_summary_table(summary)`.\n\n      +-------+-------+--------+-----------------------------------------+--------+---------+\n      | Group | #Tags | #Nodes | Members                                 |   Mean |     Std |\n      +-------+-------+--------+-----------------------------------------+--------+---------+\n      | 1     |     5 |    825 | CA, WA, OR, TT, AK                      |  0.047 | 1.1e-02 |\n      | 2     |     4 |    206 | TX, MT, PA, ID                          | -0.006 | 4.2e-03 |\n      | 3     |    43 |   1243 | MI, IN, TN, NC, VA, IL, CO, WV, MA, WI, | -0.035 | 4.3e-03 |\n      |       |       |        | SC, KY, MO, MD, AZ, PR, LA, UT, MN, GA, |        |         |\n      |       |       |        | MS, HI, DE, NM, ME, NJ, NE, VT, CT, SD, |        |         |\n      |       |       |        | IA, NV, ND, AL, OK, AR, NH, RI, OH, FL, |        |         |\n      |       |       |        | KS, NY, WY                              |        |         |\n      | 4     |     1 |      4 | VI                                      | -0.072 | 0.0e+00 |\n      +-------+-------+--------+-----------------------------------------+--------+---------+\n\nThe result suggests that states such as `CA`, `WA`, or `AK` are significantly more *popular* than other states.\n\n## Data sets\n\nWe have a companion repo\u2014[rSpringRank-data](https://github.com/junipertcy/rSpringRank-data)\u2014for data sets used in the paper. Which are:\n\n* [PhD_exchange](https://github.com/junipertcy/rSpringRank-data/tree/main/PhD_exchange)\n* [Parakeet](https://github.com/junipertcy/rSpringRank-data/tree/main/parakeet)\n\nIn addendum, we have provided the [rSpringRank.datasets](https://junipertcy.github.io/rSpringRank/datasets.html) submodule to load data sets hosted by other repositories, such as the [Netzschleuder](http://networkrepository.com/). See the docs for more information.\n\n## Development\n\nThe library uses pytest to ensure correctness. The test suite depends on [mosek](https://www.mosek.com/) and [gurobi](https://www.gurobi.com/).\n\n## License\n\n**rSpringRank** is open-source and licensed under the [GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html).\n\n",
    "bugtrack_url": null,
    "license": "LGPL-3.0-or-later",
    "summary": "Regularized methods for efficient ranking in networks",
    "version": "0.2.28",
    "project_urls": {
        "Documentation": "https://docs.netscied.tw/rSpringRank/index.html",
        "Homepage": "https://github.com/junipertcy/rSpringRank",
        "Repository": "https://github.com/junipertcy/rSpringRank"
    },
    "split_keywords": [
        "network-analysis",
        " convex-optimization",
        " ranking-algorithm",
        " proximal-gradient-method",
        " denoising"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ed7b8aabf9efcad0379a2b81c9ec4b294c8eaf4ba07df2c698766a94c346483a",
                "md5": "1ca369eb9513751a7e8c9be1e018bf15",
                "sha256": "41f5c59c5f144996c5ae40603484a3377c216d18f39fa19532b40af7addeeffb"
            },
            "downloads": -1,
            "filename": "rspringrank-0.2.28-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1ca369eb9513751a7e8c9be1e018bf15",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,!=3.9.*,>=3.10",
            "size": 47112,
            "upload_time": "2024-06-29T00:28:02",
            "upload_time_iso_8601": "2024-06-29T00:28:02.447429Z",
            "url": "https://files.pythonhosted.org/packages/ed/7b/8aabf9efcad0379a2b81c9ec4b294c8eaf4ba07df2c698766a94c346483a/rspringrank-0.2.28-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c88638bf521c9d0767db16d52d1e0cbca7d7d8a90046eb2aa010e7af3ff448b6",
                "md5": "383eefbdcd4ed726b46adfa38308c6fb",
                "sha256": "708e9d0346d6aea841df2b4b3c3983fb26a663c3ff3a6438f4918f0be7ed1f7a"
            },
            "downloads": -1,
            "filename": "rspringrank-0.2.28.tar.gz",
            "has_sig": false,
            "md5_digest": "383eefbdcd4ed726b46adfa38308c6fb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,!=3.9.*,>=3.10",
            "size": 39356,
            "upload_time": "2024-06-29T00:28:18",
            "upload_time_iso_8601": "2024-06-29T00:28:18.067638Z",
            "url": "https://files.pythonhosted.org/packages/c8/86/38bf521c9d0767db16d52d1e0cbca7d7d8a90046eb2aa010e7af3ff448b6/rspringrank-0.2.28.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-29 00:28:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "junipertcy",
    "github_project": "rSpringRank",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rspringrank"
}
        
Elapsed time: 0.25878s