a small set of graph functions to be used from pySpark on top of networkx and graphframes
Project description
splink_graph
splink_graph
is a small graph utility library meant to be used in the Apache Spark environment, that works with graph data structures
such as the ones created from the outputs of data linking processes (candicate pair results) of
Calculations are performed per cluster/connected component/subgraph in a parallel manner thanks to the underlying help from pyArrow
TL&DR :
Graph Database OLAP solutions are a few and far between. If you have spark data in a format that can be represented as a network/graph then with this package:
- Graph-theoretic metrics can be obtained efficiently using an already existing spark infrastucture without the need for a graph OLAP solution
- The results can be used as is for finding the needle (of interesting subgraphs) in the haystack (whole set of subgraphs)
- Or one can augment the available graph-compatible data as part of preprocessing step before the data-ingestion phase in an OLTP graph database (such as AWS Neptune etc)
- Another use is to provide support for feature engineering from the subgraphs/clusters for supervised and unsupervised ML downstream uses.
How to Install :
For dependencies and other important technical info so you can run these functions without an issue please consult
INSTALL.md
on this repo
Functionality offered :
For a primer on the terminology used please look at TERMINOLOGY.md
file in this repo
Cluster metrics
Cluster metrics usually have as an input a spark edgelist dataframe that also includes the component_id (cluster_id) where the edge is in. The output is a row of one or more metrics per cluster
Cluster metrics currently offered:
- diameter (largest shortest distance between nodes in a cluster)
- transitivity (or Global Clustering Coefficient in the related literature)
- cluster triangle clustering coeff (or Local Clustering Coefficient in the related literature)
- cluster square clustering coeff (useful for bipartite networks)
- cluster node connectivity
- cluster edge connectivity
- cluster efficiency
- cluster modularity
- cluster avg edge betweenness
- cluster weisfeiler lehman graphhash (in order to quickly test for graph isomorphisms)
Cluster metrics are really helpful at finding the needles (of for example clusters with possible linking errors) in the haystack (whole set of clusters after the data linking process).
Node metrics
Node metrics have as an input a spark edgelist dataframe that also includes the component_id (cluster_id) where the edge belongs. The output is a row of one or more metrics per node
Node metrics curretnly offered:
- Eigenvector Centrality
- Harmonic centrality
Edge metrics
Edge metrics have as an input a spark edgelist dataframe that also includes the component_id (cluster_id) where the edge belongs. The output is a row of one or more metrics per edge
Edge metrics curretnly offered:
- Edge Betweeness
- Bridge Edges
Functionality coming soon
- release for MVP to be used on AWS glue and demos
- cluster modularity based on partitions created by edge-betweenness
- cluster modularity based on partitions created by spectral cut
- cluster modularity based on partitions created by label propagation
- shallow embeddings of subgraphs/clusters (WIP)
For upcoming functionality further down the line please consult the TODO.md
file
Contributing
Feel free to contribute by
-
Starting an issue.
-
Forking the repository to suggest a change, and/or
-
Want a new metric implemented? Open an issue and ask. Probably it can be.
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
File details
Details for the file splink_graph-0.4.8.tar.gz
.
File metadata
- Download URL: splink_graph-0.4.8.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.7.6 Linux/4.9.0-7-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40655ede707bc4b5316d4b70f280e2ec122efba2cfa197efdcdd40920beb99f1 |
|
MD5 | e6e968d1b0d215b9a0cf6c24f5c568ad |
|
BLAKE2b-256 | 0fb40dcb7be1e26f1df47bb86c4c5efd142c95079a70d1e036190d1ffec997dc |
File details
Details for the file splink_graph-0.4.8-py3-none-any.whl
.
File metadata
- Download URL: splink_graph-0.4.8-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.7.6 Linux/4.9.0-7-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0c4ad6a857ed1cab6a35cde1e004c12ddbac2e0dc0d2a7812c9f2465ae4c662 |
|
MD5 | 9ccc5b0929fc553cb5f6db2988c25ae1 |
|
BLAKE2b-256 | b5ab7e39bcd999ec1254af057f3acede87b8466f313e2de6e21fae713de5bfbb |