graphclust 1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- graphclust/__init__.py +102 -0
- graphclust/_utils.py +86 -0
- graphclust/cluster.py +971 -0
- graphclust/data/__init__.py +1 -0
- graphclust/data/boxlinecircle.txt +7100 -0
- graphclust/datasets.py +173 -0
- graphclust/fuzzy.py +152 -0
- graphclust/graphs.py +311 -0
- graphclust/manifold.py +1135 -0
- graphclust/metrics.py +213 -0
- graphclust/plotting.py +185 -0
- graphclust/validity.py +184 -0
- graphclust/vat.py +71 -0
- graphclust/vq.py +707 -0
- graphclust-1.0.dist-info/METADATA +168 -0
- graphclust-1.0.dist-info/RECORD +18 -0
- graphclust-1.0.dist-info/WHEEL +4 -0
- graphclust-1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: graphclust
|
|
3
|
+
Version: 1.0
|
|
4
|
+
Summary: Graph-based clustering and data visualization: topology representing networks, MST and hybrid MST-Gath-Geva clustering, fuzzy neighborhood similarity, HDBSCAN*, TRNMap, Isotop, CDA, UMAP and mapping quality measures, scikit-learn compatible.
|
|
5
|
+
Project-URL: Homepage, https://github.com/ComplexSystemsIntelligence/graphclust
|
|
6
|
+
Project-URL: Documentation, https://complexsystemsintelligence.github.io/graphclust
|
|
7
|
+
Project-URL: Repository, https://github.com/ComplexSystemsIntelligence/graphclust
|
|
8
|
+
Project-URL: Issues, https://github.com/ComplexSystemsIntelligence/graphclust/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/ComplexSystemsIntelligence/graphclust/blob/main/CHANGELOG.md
|
|
10
|
+
Project-URL: Book (PDF), https://complexsystemsintelligence.github.io/graphclust/graphclust-book.pdf
|
|
11
|
+
Author: Ágnes Vathy-Fogarassy
|
|
12
|
+
Author-email: János Abonyi <janos@abonyilab.com>
|
|
13
|
+
License-Expression: MIT
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Keywords: HDBSCAN,Isomap,Jarvis-Patrick,TRNMap,UMAP,dimensionality reduction,graph-based clustering,minimal spanning tree,neural gas,topology representing network,trustworthiness
|
|
16
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering
|
|
26
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
27
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Requires-Dist: matplotlib>=3.7
|
|
30
|
+
Requires-Dist: networkx>=3.0
|
|
31
|
+
Requires-Dist: numpy>=1.24
|
|
32
|
+
Requires-Dist: scikit-learn>=1.3
|
|
33
|
+
Requires-Dist: scipy>=1.10
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: build; extra == 'dev'
|
|
36
|
+
Requires-Dist: myst-parser; extra == 'dev'
|
|
37
|
+
Requires-Dist: numpydoc; extra == 'dev'
|
|
38
|
+
Requires-Dist: pydata-sphinx-theme; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
41
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
42
|
+
Requires-Dist: sphinx-copybutton; extra == 'dev'
|
|
43
|
+
Requires-Dist: sphinx-design; extra == 'dev'
|
|
44
|
+
Requires-Dist: sphinx-gallery>=0.15; extra == 'dev'
|
|
45
|
+
Requires-Dist: sphinx>=7; extra == 'dev'
|
|
46
|
+
Requires-Dist: twine; extra == 'dev'
|
|
47
|
+
Provides-Extra: docs
|
|
48
|
+
Requires-Dist: myst-parser; extra == 'docs'
|
|
49
|
+
Requires-Dist: numpydoc; extra == 'docs'
|
|
50
|
+
Requires-Dist: pydata-sphinx-theme; extra == 'docs'
|
|
51
|
+
Requires-Dist: sphinx-copybutton; extra == 'docs'
|
|
52
|
+
Requires-Dist: sphinx-design; extra == 'docs'
|
|
53
|
+
Requires-Dist: sphinx-gallery>=0.15; extra == 'docs'
|
|
54
|
+
Requires-Dist: sphinx>=7; extra == 'docs'
|
|
55
|
+
Provides-Extra: leiden
|
|
56
|
+
Requires-Dist: igraph>=0.11; extra == 'leiden'
|
|
57
|
+
Requires-Dist: leidenalg>=0.10; extra == 'leiden'
|
|
58
|
+
Provides-Extra: test
|
|
59
|
+
Requires-Dist: pytest-cov; extra == 'test'
|
|
60
|
+
Requires-Dist: pytest>=7; extra == 'test'
|
|
61
|
+
Description-Content-Type: text/markdown
|
|
62
|
+
|
|
63
|
+
<p align="center"><img src="https://raw.githubusercontent.com/ComplexSystemsIntelligence/graphclust/main/docs/_static/banner.png" alt="graphclust: graph-based clustering and data visualization in Python"></p>
|
|
64
|
+
|
|
65
|
+
# graphclust: graph-based clustering and data visualization in Python
|
|
66
|
+
|
|
67
|
+
[](https://github.com/ComplexSystemsIntelligence/graphclust/actions/workflows/ci.yml)
|
|
68
|
+
[](https://complexsystemsintelligence.github.io/graphclust)
|
|
69
|
+
[](https://pypi.org/project/graphclust/)
|
|
70
|
+
[](https://github.com/ComplexSystemsIntelligence/graphclust/blob/main/LICENSE)
|
|
71
|
+
|
|
72
|
+
**graphclust** is a scikit-learn compatible toolbox for clustering and
|
|
73
|
+
visualizing data through graphs: neighborhood graphs and geodesic distances,
|
|
74
|
+
topology learning with neural gas and topology representing networks,
|
|
75
|
+
clustering with spanning trees, shared neighbors and communities, and maps of
|
|
76
|
+
high-dimensional data from Sammon's mapping to TRNMap and UMAP. It is the
|
|
77
|
+
Python successor of the MATLAB toolbox that accompanied the monograph
|
|
78
|
+
*Graph-Based Clustering and Data Visualization Algorithms* (Á. Vathy-Fogarassy,
|
|
79
|
+
J. Abonyi, SpringerBriefs in Computer Science, 2013), extended with the main
|
|
80
|
+
graph-based methods published since then.
|
|
81
|
+
|
|
82
|
+
| Module | Contents |
|
|
83
|
+
|---|---|
|
|
84
|
+
| `graphclust.graphs` | kNN, mutual kNN, ε, nearest neighbor, MST, relative neighborhood, Gabriel and Delaunay graphs; competitive Hebbian (induced Delaunay) graph; shared-neighbor counts; geodesic distances |
|
|
85
|
+
| `graphclust.vq` | LBG, neural gas, topology representing network, growing neural gas, grow when required, dynamic TRN, weighted incremental network |
|
|
86
|
+
| `graphclust.cluster` | Zahn's MST clustering, hybrid MST–Gath–Geva, HDBSCAN\*, Jarvis–Patrick, fuzzy neighborhood similarity, SNN density clustering, density peaks, self-tuning spectral clustering, Louvain/Leiden communities |
|
|
87
|
+
| `graphclust.validity` | Dunn index with MST diameters, Fukuyama–Sugeno, fuzzy hypervolume, DBCV, eigengap, clustering rate |
|
|
88
|
+
| `graphclust.vat` | VAT and iVAT images |
|
|
89
|
+
| `graphclust.manifold` | classical/metric/non-metric MDS, Sammon, LPP, SOM, incremental grid growing, Isomap, Isotop, CCA/CDA, OVI-NG, GNLP-NG, TRNMap, Laplacian eigenmaps, diffusion maps, UMAP, t-SNE |
|
|
90
|
+
| `graphclust.metrics` | Sammon and MDS stress, residual variance, trustworthiness, continuity, co-ranking matrix, Q_NX, R_NX, LCMC, AUC, topographic error and product |
|
|
91
|
+
| `graphclust.datasets`, `plotting` | Variety, ChainLink, Curves, Boxlinecircle and manifold generators; plotting helpers |
|
|
92
|
+
|
|
93
|
+
## Installation
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
pip install graphclust # numpy, scipy, scikit-learn, networkx, matplotlib
|
|
97
|
+
pip install "graphclust[leiden]" # optional Leiden community detection
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Quick start
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
from graphclust import TRNMap, HybridMSTGG, HDBSCANStar, fuzzy_neighborhood_similarity
|
|
104
|
+
from graphclust.datasets import make_s_curve, make_chainlink
|
|
105
|
+
from graphclust.metrics import trustworthiness_continuity
|
|
106
|
+
|
|
107
|
+
# map a curved manifold with the topology representing network map
|
|
108
|
+
X, t = make_s_curve(2000, random_state=0)
|
|
109
|
+
tm = TRNMap(n_nodes=150, random_state=0).fit(X)
|
|
110
|
+
tm.nodes_, tm.adjacency_, tm.embedding_
|
|
111
|
+
print(trustworthiness_continuity(tm.dist_matrix_, tm.embedding_, 5, precomputed=True))
|
|
112
|
+
|
|
113
|
+
# cluster groups joined by a chain
|
|
114
|
+
Xc, yc = make_chainlink()
|
|
115
|
+
hyb = HybridMSTGG(max_clusters=4, lambda_=2.5).fit(Xc)
|
|
116
|
+
hyb.labels_, hyb.membership_, hyb.covariances_
|
|
117
|
+
HDBSCANStar(min_cluster_size=8).fit(Xc).labels_
|
|
118
|
+
|
|
119
|
+
# shared-neighbor similarity for hierarchical clustering, MDS or VAT
|
|
120
|
+
S = fuzzy_neighborhood_similarity(Xc, k=6, r_max=3, alpha=0.2)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## The book
|
|
124
|
+
|
|
125
|
+
*Graph-Based Clustering and Data Visualization in Python: The graphclust
|
|
126
|
+
toolbox* (Á. Vathy-Fogarassy, J. Abonyi) develops every method in one notation
|
|
127
|
+
and illustrates it with the scripts of the example gallery. It is available as
|
|
128
|
+
a [web edition](https://complexsystemsintelligence.github.io/graphclust/book/),
|
|
129
|
+
[PDF](https://complexsystemsintelligence.github.io/graphclust/graphclust-book.pdf)
|
|
130
|
+
and [EPUB](https://complexsystemsintelligence.github.io/graphclust/graphclust-book.epub)
|
|
131
|
+
under CC BY 4.0. The book is a new text: it re-derives and re-implements the
|
|
132
|
+
methods of the 2013 monograph and adds HDBSCAN\*, DBCV, density peaks,
|
|
133
|
+
Louvain/Leiden communities, iVAT, the co-ranking framework, diffusion maps,
|
|
134
|
+
t-SNE and UMAP.
|
|
135
|
+
|
|
136
|
+
## Documentation
|
|
137
|
+
|
|
138
|
+
* [Example gallery](https://complexsystemsintelligence.github.io/graphclust/auto_examples/index.html):
|
|
139
|
+
29 scripts, each runnable as a Jupyter notebook (Binder, Colab).
|
|
140
|
+
* [API reference](https://complexsystemsintelligence.github.io/graphclust/api/index.html).
|
|
141
|
+
* [Migration from the MATLAB toolbox](https://complexsystemsintelligence.github.io/graphclust/migration.html).
|
|
142
|
+
|
|
143
|
+
## Development
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
git clone https://github.com/ComplexSystemsIntelligence/graphclust.git
|
|
147
|
+
cd graphclust
|
|
148
|
+
pip install -e ".[dev]"
|
|
149
|
+
pytest # unit tests and doctests
|
|
150
|
+
book/build.sh # the book (TeX Live with raleway, plex, libertinus, biber)
|
|
151
|
+
sphinx-build -b html docs docs/_build/html
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Citing
|
|
155
|
+
|
|
156
|
+
Please cite the package (see `CITATION.cff`) together with the original
|
|
157
|
+
publications of the methods you use; every docstring and every chapter of the
|
|
158
|
+
book lists them.
|
|
159
|
+
|
|
160
|
+
## Acknowledgments
|
|
161
|
+
|
|
162
|
+
The research summarized in the package and the book was supported by the
|
|
163
|
+
National Research, Development and Innovation Office of Hungary (NKFIH)
|
|
164
|
+
through the OTKA 143482 project.
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
Software: MIT. Book: CC BY 4.0.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
graphclust/__init__.py,sha256=TlD9Qn-UodDBEPmDJ6Ftq4pMlrW-Hyri0Yrm1c9CCZ4,3025
|
|
2
|
+
graphclust/_utils.py,sha256=cRpnq-cpnPL0ku5uY6TDG3_rcqUDkQ1JPO3Utc92dW0,2880
|
|
3
|
+
graphclust/cluster.py,sha256=9hX3iu3yVc2aVEBJEnES_ExWxIiYgEoCVZkTcu6pTUM,37924
|
|
4
|
+
graphclust/datasets.py,sha256=0zygZfi7mSCyud2RHOSFR9IFj4saxvRiEnnZaagGA1I,6694
|
|
5
|
+
graphclust/fuzzy.py,sha256=Og4PqxooOBkhey2PUxU_OlDyL6_Q3eP_OeDSIUg7CJE,5793
|
|
6
|
+
graphclust/graphs.py,sha256=oM5PL8hNt36hY_x6ig7ftZJXna5d14nvEjeSUAnjs6M,12181
|
|
7
|
+
graphclust/manifold.py,sha256=g46m445XkOQP_dsHq3ZXVL3QsLInrbDNz0r8wV3cvsI,45348
|
|
8
|
+
graphclust/metrics.py,sha256=ciTW611nlmgLhhYHYvw0PK9-v-FZ_0I0P8vwgpaMHMA,8602
|
|
9
|
+
graphclust/plotting.py,sha256=POF16uV1CFGBMbIYSr6zb0KZK17VRIdedFoAh3ZvAww,6747
|
|
10
|
+
graphclust/validity.py,sha256=FBb87El12dglqRSCF_uExe6LRBwpzM_pUhWAIf88Wms,7407
|
|
11
|
+
graphclust/vat.py,sha256=4dynnLMPJ1157eQv6CotLgV28aAR8RxsNACgK5En9rU,2361
|
|
12
|
+
graphclust/vq.py,sha256=oR6zFuDuRN_6tqMhsB-2zuVNws4xwgrevSBcMkd3bbM,27639
|
|
13
|
+
graphclust/data/__init__.py,sha256=_K_e3jtxNpFRSYEcPUKxez6RpNzwYKuk34EcXs058VA,42
|
|
14
|
+
graphclust/data/boxlinecircle.txt,sha256=SDUYGGa3x877LmTZOYtlWehDFnDFFLSI_JIiv8usFKk,268316
|
|
15
|
+
graphclust-1.0.dist-info/METADATA,sha256=mHG4iK5-XNcCRshNDdi530S_GUFa9lxkEs6F5YmkB_Q,8800
|
|
16
|
+
graphclust-1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
17
|
+
graphclust-1.0.dist-info/licenses/LICENSE,sha256=2mbOogNVOZ6Axv6lwHP-RekOommlmnCu1f3Oz5wYTnA,1094
|
|
18
|
+
graphclust-1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ágnes Vathy-Fogarassy, János Abonyi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|