Computing Krackhardt hierarchy score on NetowrkX graphs
Project description
pyKrack
Install
Due to the comparisons with the R package sna
we recommend using conda
to manage your environment.
- First create the pykrack conda environment from the environment.yml file:
conda (or mamba) env create -f environment.yml
- Then load the conda environment with:
conda activate pykrack
- And finally install the package from pip via the following command:
pip install pyKrack
Alternatively pyKrack can also be isntalled using pip via the following command
pip install pyKrack
Then install the R dependencies listed in the conda environmnet.yml manually.
How to use
Please see the core and hierarchy notebooks for more detailed explanations.
pyKrack consists of one main function,
compute_hierarchy
.
compute_hierarchy
compute_hierarchy (G, metric='pykrack')
Compute one of the possible hierarchy scores
Type | Default | Details | |
---|---|---|---|
G | Directed NetworkX graph | ||
metric | str | pykrack | Type of hierarchy metric to compute. Accepted types are: ‘pykrack’ for this module’s implementation of the Krackhardt score. ‘rsnakrack’ for the sna implementation in R. ‘hierarchy_flow’ for the Luo and Magee 2011 as implemented in the NetworkX package. |
Returns | float | One of the possible hierarchy scores |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pykrack-0.0.3.tar.gz
(9.3 kB
view details)
Built Distribution
File details
Details for the file pykrack-0.0.3.tar.gz
.
File metadata
- Download URL: pykrack-0.0.3.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93ef8a88fd32313f27872af620b7ab96e336fe863ee89d490e48145788d0e620 |
|
MD5 | 3a9ab0a22c4153d568c759523e2c6bd0 |
|
BLAKE2b-256 | b9b2e69fd057348ae3a289e73b9f9202e2ac582f9d8fbcdb87f93911ac9c1de4 |
File details
Details for the file pykrack-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: pykrack-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0950abae4d7814ece14c31c032b2bedb54a0202682da795a211ba8da5778d4ba |
|
MD5 | 929607551324dedce9950a468c2c6b46 |
|
BLAKE2b-256 | 53a1c7bad4d22eb641b9ed31fc8c329f55de424d6da8edca372e0758d9fb582d |