Skip to content

Commit

Permalink
Merge pull request #194 from deargle/fix-fixed-min-samples
Browse files Browse the repository at this point in the history
Fix fixed min samples
  • Loading branch information
deargle authored Aug 26, 2020
2 parents 925f09c + 76d2ac3 commit 4c573af
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ dist
.vscode
.ipynb_checkpoints
_modules
.tox/
.python-version

15 changes: 6 additions & 9 deletions kmapper/kmapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,15 +500,12 @@ def map(
# we consider clustering or skipping it.
cluster_params = clusterer.get_params()

if precomputed:
min_cluster_samples = 2
else:
min_cluster_samples = cluster_params.get(
"n_clusters",
cluster_params.get(
"min_cluster_size", cluster_params.get("min_samples", 1)
),
)
min_cluster_samples = cluster_params.get(
"n_clusters",
cluster_params.get(
"min_cluster_size", cluster_params.get("min_samples", 2)
),
)

if self.verbose > 1:
print(
Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tox]
envlist = py27, py34, py35, py36, py37, py38

[testenv]
deps = pytest
commands = pytest {posargs}
extras = testing

0 comments on commit 4c573af

Please sign in to comment.