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

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for pykrack-0.0.3.tar.gz
Algorithm Hash digest
SHA256 93ef8a88fd32313f27872af620b7ab96e336fe863ee89d490e48145788d0e620
MD5 3a9ab0a22c4153d568c759523e2c6bd0
BLAKE2b-256 b9b2e69fd057348ae3a289e73b9f9202e2ac582f9d8fbcdb87f93911ac9c1de4

See more details on using hashes here.

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

Hashes for pykrack-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0950abae4d7814ece14c31c032b2bedb54a0202682da795a211ba8da5778d4ba
MD5 929607551324dedce9950a468c2c6b46
BLAKE2b-256 53a1c7bad4d22eb641b9ed31fc8c329f55de424d6da8edca372e0758d9fb582d

See more details on using hashes here.

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