From cbb39eecf2b8e67803725f4867bc5501eb32beea Mon Sep 17 00:00:00 2001 From: Sebastian Markgraf Date: Thu, 21 Jan 2021 09:33:31 +0100 Subject: [PATCH 1/2] Fix finding spectral gap with identical diffs --- heat/cluster/spectral.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heat/cluster/spectral.py b/heat/cluster/spectral.py index 380b39d992..293b039518 100644 --- a/heat/cluster/spectral.py +++ b/heat/cluster/spectral.py @@ -150,7 +150,7 @@ def fit(self, X): # 3. Find the spectral gap, if number of clusters is not defined from the outside if self.n_clusters is None: diff = eigenvalues[1:] - eigenvalues[:-1] - tmp = ht.where(diff == diff.max()).item() + tmp = ht.argmax(diff).item() self.n_clusters = tmp + 1 components = eigenvectors[:, : self.n_clusters].copy() From c3316f7e91ac76f02216e73c1ef214d862306145 Mon Sep 17 00:00:00 2001 From: Sebastian Markgraf Date: Thu, 21 Jan 2021 09:41:50 +0100 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f82d4ef089..df6f1830d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ ### ... ## Bug fixes +- [#716](https://github.com/helmholtz-analytics/heat/pull/716) Bugfix: Finding clusters by spectral gap fails when multiple diffs identical + # v0.5.2 - [#706](https://github.com/helmholtz-analytics/heat/pull/706) Bug fix: prevent `__setitem__`, `__getitem__` from modifying key in place