Skip to main content

GraphPCA

Produces a low-dimensional representation of the input graph.

Calculates the ECTD [1] of the graph and reduces its dimension using PCA. The result is an embedding of the graph nodes as vectors in a low-dimensional space.

Graph data in this repository is courtesy of University of Florida Sparse Matrix Collection.

Python 3.x and 2.6+.

See the API docs: https://brandones.github.io/graphpca/

Usage

Draw a graph, including edges, from a mat file

>>> import scipy.io
>>> import networkx as nx
>>> import graphpca
>>> mat = scipy.io.loadmat('test/bcspwr01.mat')
>>> A = mat['Problem'][0][0][1].todense()  # that's just how the file came
>>> G = nx.from_numpy_array(A)
>>> graphpca.draw_graph(G)
output/bcspwr01-drawing.png

Get a 2D PCA of a high-dimensional graph and plot it.

>>> import networkx as nx
>>> import graphpca
>>> g = nx.erdos_renyi_graph(1000, 0.2)
>>> g_2 = graphpca.reduce_graph(g, 2)
>>> graphca.plot_2d(g_2)
output/erg-1000.png

Contributing

Issues and Pull requests are very welcome! [On GitHub](https://github.com/brandones/graphpca).

Metadata

Release files for graphpca 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphpca 1.1.1
File Size Uploaded Provenance Actions
graphpca-1.1.1.tar.gz 7.0 kB Without provenance Details for graphpca-1.1.1.tar.gz

Release files / graphpca-1.1.1.tar.gz

Download URL graphpca-1.1.1.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f52eea9590e8575050af3368bf62a4506de513280fa5d65e6db37eaab549237e
BLAKE2b-256 checksum
How to use checksums
3d8f682e1594aff9f7138bead7f5c310e5690251c137b32b1c12c28ca1fd33c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Security for graphpca 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page