regrank


Nameregrank JSON
Version 0.2.30 PyPI version JSON
download
home_pagehttps://github.com/junipertcy/regrank
SummaryRegularized methods for efficient ranking in networks
upload_time2024-06-30 06:41:48
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/regrank/blob/main/LICENSE) [![PyPI version](https://img.shields.io/pypi/v/regrank.svg)](https://pypi.org/project/regrank/) [![PyPI downloads](https://img.shields.io/pypi/dm/regrank.svg?label=Pypi%20downloads)](https://pypi.org/project/regrank/) [![Build Status](https://github.com/junipertcy/regrank/actions/workflows/release.yml/badge.svg)](https://github.com/junipertcy/regrank/actions) [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)

**regrank** 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/regrank/index.html).
* General Q&A, ideas, or other things, please visit [Discussions](https://github.com/junipertcy/regrank/discussions).
* Software-related bugs, issues, or suggestions, please use [Issues](https://github.com/junipertcy/regrank/issues).

## Installation

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

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

## Example

```python
# Import the library
import regrank as rr

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

# Create a model
model = rr.optimize.regrank(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 = rr.compute_summary(g, "state_abr", primal_s=result["primal"])
```

Let's plot the rankings, via `rr.plot_hist(summary)`. Note that most of the node categories 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 `rr.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—[regrank-data](https://github.com/junipertcy/regrank-data)—for data sets used in the paper. Which are:

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

In addendum, we have provided the [regrank.datasets](https://junipertcy.github.io/regrank/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

**regrank** 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/regrank",
    "name": "regrank",
    "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/05/4a/2da9badb5a1043fa2ed6b5497ec3eb2f601e5df8518795d91d48295bfd5d/regrank-0.2.30.tar.gz",
    "platform": null,
    "description": "[![license](https://img.shields.io/badge/license-LGPL-green.svg?style=flat)](https://github.com/junipertcy/regrank/blob/main/LICENSE) [![PyPI version](https://img.shields.io/pypi/v/regrank.svg)](https://pypi.org/project/regrank/) [![PyPI downloads](https://img.shields.io/pypi/dm/regrank.svg?label=Pypi%20downloads)](https://pypi.org/project/regrank/) [![Build Status](https://github.com/junipertcy/regrank/actions/workflows/release.yml/badge.svg)](https://github.com/junipertcy/regrank/actions) [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)\n\n**regrank** 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/regrank/index.html).\n* General Q&A, ideas, or other things, please visit [Discussions](https://github.com/junipertcy/regrank/discussions).\n* Software-related bugs, issues, or suggestions, please use [Issues](https://github.com/junipertcy/regrank/issues).\n\n## Installation\n\n**regrank** is available on PyPI. It also depends on `graph-tool`. We recommend using `conda` to manage packages.\n\n```bash\nconda create --name regrank-dev -c conda-forge graph-tool\nconda activate regrank-dev\npip install regrank\n```\n\n## Example\n\n```python\n# Import the library\nimport regrank as rr\n\n# Load a data set\ng = rr.datasets.us_air_traffic()\n\n# Create a model\nmodel = rr.optimize.regrank(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 = rr.compute_summary(g, \"state_abr\", primal_s=result[\"primal\"])\n```\n\nLet's plot the rankings, via `rr.plot_hist(summary)`. Note that most of the node categories 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 `rr.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[regrank-data](https://github.com/junipertcy/regrank-data)\u2014for data sets used in the paper. Which are:\n\n* [PhD_exchange](https://github.com/junipertcy/regrank-data/tree/main/PhD_exchange)\n* [Parakeet](https://github.com/junipertcy/regrank-data/tree/main/parakeet)\n\nIn addendum, we have provided the [regrank.datasets](https://junipertcy.github.io/regrank/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**regrank** 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.30",
    "project_urls": {
        "Documentation": "https://docs.netscied.tw/regrank/index.html",
        "Homepage": "https://github.com/junipertcy/regrank",
        "Repository": "https://github.com/junipertcy/regrank"
    },
    "split_keywords": [
        "network-analysis",
        " convex-optimization",
        " ranking-algorithm",
        " proximal-gradient-method",
        " denoising"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ab92a876db404cb8f8299abe1ab90269e73ac2869fa50d8cc0ce53459c1b12a0",
                "md5": "791a9ef4d64b679d2db61a0bb29688b0",
                "sha256": "55b31849d2dae3cc91f2ab9429cc9c0482c537588f3a8fd602e5eaedb2272221"
            },
            "downloads": -1,
            "filename": "regrank-0.2.30-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "791a9ef4d64b679d2db61a0bb29688b0",
            "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": 46834,
            "upload_time": "2024-06-30T06:41:47",
            "upload_time_iso_8601": "2024-06-30T06:41:47.003945Z",
            "url": "https://files.pythonhosted.org/packages/ab/92/a876db404cb8f8299abe1ab90269e73ac2869fa50d8cc0ce53459c1b12a0/regrank-0.2.30-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "054a2da9badb5a1043fa2ed6b5497ec3eb2f601e5df8518795d91d48295bfd5d",
                "md5": "29f86808351d03b6bf72e65d64b2acf5",
                "sha256": "186ce19428760770b4bf5439377b8c6606bd768efed5d9c8717c530b067a68b6"
            },
            "downloads": -1,
            "filename": "regrank-0.2.30.tar.gz",
            "has_sig": false,
            "md5_digest": "29f86808351d03b6bf72e65d64b2acf5",
            "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": 39652,
            "upload_time": "2024-06-30T06:41:48",
            "upload_time_iso_8601": "2024-06-30T06:41:48.285623Z",
            "url": "https://files.pythonhosted.org/packages/05/4a/2da9badb5a1043fa2ed6b5497ec3eb2f601e5df8518795d91d48295bfd5d/regrank-0.2.30.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-30 06:41:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "junipertcy",
    "github_project": "regrank",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "regrank"
}
        
Elapsed time: 0.83069s