Python package to construct and describe neonatal transfer networks.
Project description
infantnetwork
Python package for constructing networks from infant transfer records. Functions and example code is provided to construct networks and describe their shape and structure.
infantnetwork uses the computational backends NetworkX and igraph.
Code is released under the open-source MIT License.
Installation
Install the package using pip:
pip install infantnetwork
Usage
from infantnetwork import computeNetwork, sample_transfers
#Compute network using default settings
output = computeNetwork(sample_transfers)
#Extract graphs
graph_networkx = output['graph_networkx']
graph_igraph = output['graph_igraph']
#Metrics
network_metrics = output['metrics']
#Extract a single network metric
network_metrics['centrality_mean_receiving']
The network_metrics atribute of computeNetwork returns the following quantatitve network metrics:
| Metric | Description |
|---|---|
n_nodes |
Number of nodes in the network. |
n_edges |
Total number of edges in the network. |
n_transfers |
Total number of transfers in the network. |
n_self_loops |
Number of self-loops. |
centrality_median |
Median node Katz centrality. |
centrality_mean_receiving |
Mean node Katz centrality of nodes with incoming transfers. |
density_unweighted |
Network density (total proportion of possible edges observed) |
density_weighted |
Weighted network density: $$\frac{\sum \text{(edge weights)}}{\text{(n edges)} \cdot \max(\text{(edge weights)})}$$ |
efficiency_global |
Global network efficiency. |
efficiency_median_local |
Median of local node efficiencies. |
modularity_greedy |
Network modularity using the greedy community modularity algorithm. |
modularity_randomwalk |
Network modularity using random walktrap algorithm |
max_node_percentage_by_component |
Percentage of nodes in the largest connected component. |
max_weight_percentage_by_component |
Percentage of weight (transfers) within the largest connected component. |
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file infantnetwork-0.1.2.tar.gz.
File metadata
- Download URL: infantnetwork-0.1.2.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63677d0ea0ff63b439f47475ca035709459bfe69e853302b9babf1f7bd49d6ee
|
|
| MD5 |
068a916523fc8ea93e041698339ed336
|
|
| BLAKE2b-256 |
eda60dbb6b5be9e488679738705326e8fb538b60f55e008223f952faa4a3903d
|
File details
Details for the file infantnetwork-0.1.2-py3-none-any.whl.
File metadata
- Download URL: infantnetwork-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52c120436755cec34157db8b29fc1fcde82e0fb3f16fafdd575ae2bab262a925
|
|
| MD5 |
b44352ee28b2429899e557c1e67ef49d
|
|
| BLAKE2b-256 |
b95fa3325543c39e304c9f63efc23d4d7512a5d50ea281a5e8ccb85337d03cff
|