Skip to content

Commit

Permalink
Merge pull request #716 from sebimarkgraf/fix/spectral-gap
Browse files Browse the repository at this point in the history
Fix finding spectral gap with identical diffs
  • Loading branch information
coquelin77 committed Mar 11, 2021
2 parents 34c356b + 68999bb commit ebaf73c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

## Bug fixes
- [#709](https://github.com/helmholtz-analytics/heat/pull/709) Set the encoding for README.md in setup.py explicitly.
- [#716](https://github.com/helmholtz-analytics/heat/pull/716) Bugfix: Finding clusters by spectral gap fails when multiple diffs identical
- [#735](https://github.com/helmholtz-analytics/heat/pull/735) Set return type to bool in relational functions.

# v0.5.2
Expand Down
2 changes: 1 addition & 1 deletion heat/cluster/spectral.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ebaf73c

Please sign in to comment.