Skip to main content

Computing Krackhardt hierarchy score on NetowrkX graphs

Project description

pyKrack

CI PyPI version

Install

Due to the comparisons with the R package sna we recommend using conda to manage your environment.

  1. First create the pykrack conda environment from the environment.yml file:
conda (or mamba) env create -f environment.yml
  1. Then load the conda environment with:
conda activate pykrack
  1. 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.


source

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


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 hashes)

Uploaded Source

Built Distribution

pykrack-0.0.3-py3-none-any.whl (9.6 kB view hashes)

Uploaded Python 3

Supported by

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