Skip to content

Commit 2e3de9f

Browse files
committed
prepare 0.4.0, tweaks docs
1 parent e46d6aa commit 2e3de9f

4 files changed

Lines changed: 21 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
For changes to the main Rust package, please see <https://github.com/kno10/rust-kmedoids/blob/main/CHANGELOG.md>
44

5+
## kmedoids 0.4.0 (2022-09-23)
6+
7+
- Add PAMSIL, PAMMEDSIL, FastMSC, FasterMSC (Lars Lenssen)
8+
59
## kmedoids 0.3.3 (2022-07-06)
610

711
- Improved platform support (prebuilt for manylinux, OSX, Windows) by David Muhr

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
edition = "2021"
33
name = "kmedoids"
4-
version = "0.3.3"
4+
version = "0.4.0"
55
authors = ["Erich Schubert <erich.schubert@tu-dortmund.de>", "Lars Lenssen <lars.lenssen@tu-dortmund.de>"]
66
description = "k-Medoids clustering with the FasterPAM algorithm"
77
homepage = "https://github.com/kno10/python-kmedoids"
@@ -14,14 +14,14 @@ name = "kmedoids"
1414
crate-type = ["cdylib"]
1515

1616
[dependencies]
17-
rustkmedoids = { version = "0.3.3", package = "kmedoids", git = "https://github.com/kno10/rust-kmedoids" }
17+
rustkmedoids = { version = "0.4.0", package = "kmedoids", git = "https://github.com/kno10/rust-kmedoids" }
1818
numpy = "0.16"
1919
ndarray = "0.15"
2020
rand = "0.8"
2121
rayon = "1.5"
2222

2323
[dependencies.pyo3]
24-
version = "0.16.5"
24+
version = "0.17.1"
2525
features = ["extension-module"]
2626

2727
[package.metadata.maturin]

docs/index.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ PAM
137137

138138
.. _Alternating:
139139

140-
Alternating k=medoids (k-means style)
140+
Alternating k-medoids (k-means style)
141141
=====================================
142142

143143
.. autofunction:: alternating
@@ -221,11 +221,12 @@ an earlier (slower, and now obsolete) version was published as:
221221
| https://doi.org/10.1007/978-3-030-32047-8_16
222222
| Preprint: https://arxiv.org/abs/1810.05691
223223
224-
For further details on the implemented algorithm FasterMSC, see:
224+
For further details on medoid Silhouette clustering with FasterMSC, see:
225225

226-
| Lars Lenssen, Erich Schubert:
227-
| Clustering by Direct Optimization of the Medoid Silhouette
228-
| In: 15th International Conference on Similarity Search and Applications (SISAP 2022).
226+
| Lars Lenssen, Erich Schubert:
227+
| **Clustering by Direct Optimization of the Medoid Silhouette**
228+
| In: 15th International Conference on Similarity Search and Applications (SISAP 2022).
229+
| https://doi.org/10.1007/978-3-031-17849-8_15
229230
230231
This is a port of the original Java code from `ELKI <https://elki-project.github.io/>`_ to Rust.
231232
The `Rust version <https://github.com/kno10/rust-kmedoids>`_ is then wrapped for use with Python.

kmedoids/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
| Lars Lenssen, Erich Schubert:
3737
| Clustering by Direct Optimization of the Medoid Silhouette
3838
| In: 15th International Conference on Similarity Search and Applications (SISAP 2022).
39+
| https://doi.org/10.1007/978-3-031-17849-8_15
3940
4041
| Leonard Kaufman, Peter J. Rousseeuw:
4142
| Clustering by means of medoids.
@@ -460,6 +461,7 @@ def fastmsc(diss, medoids, max_iter=100, init="random", random_state=None):
460461
| Lars Lenssen, Erich Schubert:
461462
| Clustering by Direct Optimization of the Medoid Silhouette
462463
| In: 15th International Conference on Similarity Search and Applications (SISAP 2022).
464+
| https://doi.org/10.1007/978-3-031-17849-8_15
463465
464466
:param diss: square numpy array of dissimilarities
465467
:type diss: ndarray
@@ -503,6 +505,7 @@ def fastermsc(diss, medoids, max_iter=100, init="random", random_state=None):
503505
| Lars Lenssen, Erich Schubert:
504506
| Clustering by Direct Optimization of the Medoid Silhouette
505507
| In: 15th International Conference on Similarity Search and Applications (SISAP 2022).
508+
| https://doi.org/10.1007/978-3-031-17849-8_15
506509
507510
:param diss: square numpy array of dissimilarities
508511
:type diss: ndarray
@@ -646,7 +649,7 @@ class SKLearnClusterer(BaseEstimator, ClusterMixin, TransformerMixin):
646649

647650

648651
class KMedoids(SKLearnClusterer):
649-
"""K-Medoids Clustering using PAM and FasterPAM (sklearn-compatible API).
652+
"""K-Medoids Clustering using PAM, FasterPAM, and FasterMSC (sklearn-compatible API).
650653
651654
References:
652655
@@ -665,6 +668,7 @@ class KMedoids(SKLearnClusterer):
665668
| Lars Lenssen, Erich Schubert:
666669
| Clustering by Direct Optimization of the Medoid Silhouette
667670
| In: 15th International Conference on Similarity Search and Applications (SISAP 2022).
671+
| https://doi.org/10.1007/978-3-031-17849-8_15
668672
669673
| Leonard Kaufman, Peter J. Rousseeuw:
670674
| Clustering by means of medoids.
@@ -760,7 +764,9 @@ def fit(self, X, y=None):
760764
else:
761765
raise ValueError(
762766
f"method={self.method} is not supported. Supported methods "
763-
f"are 'fasterpam', 'fastpam1', 'pam' and 'alternate'."
767+
f"are 'fasterpam', 'fastpam1', 'pam', 'alternate', "
768+
f"'fastermsc', 'fastmsc', 'pamsil', and 'pammedsil'. "
769+
f"Recommended values are 'fasterpam' for classic k-medoids and 'fastermsc' for Silhouette optimization."
764770
)
765771
self.labels_ = result.labels
766772
self.medoid_indices_ = result.medoids

0 commit comments

Comments
 (0)