XGI extension for faster hypergraph operations
Project description
What has been done?:
- Metrics computation has been updated
- The implementation of bipartite graphs has been changed
- Application of graph and hypergraph metrics to improve ML models
- Cpp implementation of linegraph
Metrics computation has been updated
The computation of the linegraph vector centrality metric was accelerated by using the igraph library instead of networkx . For comparison, implementations using the networkx.Graph class were retained.
H_enron = xgi.load_xgi_data("plant-pollinator-mpl-034")
H_enron_cleaned = H_enron.cleanup(
multiedges=False, singletons=False, isolates=False, relabel=True, in_place=False
)
start_time = time.time()
xgi.centrality.line_vector_centrality(H_enron_cleaned)
middle_time = time.time()
xgi.centrality.fast_line_vector_centrality(H_enron_cleaned)
end_time = time.time()
print(f"Время выполнения nx: {(middle_time-start_time):.6f} секунд")
print(f"Время выполнения ig: {(end_time-middle_time):.6f} секунд")
The implementation of bipartite graphs has been changed.
The implementation for working with bipartite graphs was modified: the igraph.Graph class is now used instead of networkx.Graph for converting from a Hypergraph to a bipartite graph and back to a Hypergraph .
hg = xgi.Hypergraph()
hg.add_edges_from(
[[1, 2, 3], [3, 4, 5,8], [1, 4, 10, 11, 12], [7,0,8], [5,7,2]]
)
bpg = xgi.convert.to_bipartite_graph(hg)
plot(bpg,vertex_label=bpg.vs.indices,layout = Graph.layout_bipartite(bpg), bbox=(0, 0, 500,500))
Application of graph and hypergraph metrics to improve ML models
In the file for solving the classification problem, in addition to article embeddings, article identifiers, and author IDs used as features, metrics such as eigenvector centrality of the graph and vector centrality of the hypergraph were also utilized.
Cpp implementation of linegraph
- In progress...
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 xgi_optimized-0.11.tar.gz.
File metadata
- Download URL: xgi_optimized-0.11.tar.gz
- Upload date:
- Size: 61.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc141a8c31e495f041e1516c04b69779acd8e81b1210a23869a48ac08cc8ccef
|
|
| MD5 |
773a90788ca7dd52654a04a66aacaaea
|
|
| BLAKE2b-256 |
96c75d875b852e2ea4095b26144b11f776121510f5688602749ae171f6033947
|
File details
Details for the file xgi_optimized-0.11-cp313-cp313-manylinux_2_17_x86_64.whl.
File metadata
- Download URL: xgi_optimized-0.11-cp313-cp313-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 277.2 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16a7b3eb533c1ce48b1a329c04ea13a84e797c99df7d22d06575b1532922dcae
|
|
| MD5 |
cc7bc8e2fa2870e5100c72ec33ffd796
|
|
| BLAKE2b-256 |
ca463043fcfb975b1fa5df7ab50e2908ff079c6283b2c657a225d6494e05f2a0
|