Skip to content

Commit

Permalink
Merge pull request #563 from scikit-learn-contrib/issue_562
Browse files Browse the repository at this point in the history
Use a positional argument for the cachedir/location
  • Loading branch information
lmcinnes committed Sep 16, 2022
2 parents 379d523 + d829c63 commit ccd8535
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/basic_hdbscan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ want do some method chaining.
.. parsed-literal::
HDBSCAN(algorithm='best', alpha=1.0, approx_min_span_tree=True,
gen_min_span_tree=False, leaf_size=40, memory=Memory(cachedir=None),
gen_min_span_tree=False, leaf_size=40, memory=Memory(None),
metric='euclidean', min_cluster_size=5, min_samples=None, p=None)
Expand Down
2 changes: 1 addition & 1 deletion docs/how_hdbscan_works.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ library <https://github.com/scikit-learn-contrib/hdbscan>`__ and get to work.
.. parsed-literal::
HDBSCAN(algorithm='best', alpha=1.0, approx_min_span_tree=True,
gen_min_span_tree=True, leaf_size=40, memory=Memory(cachedir=None),
gen_min_span_tree=True, leaf_size=40, memory=Memory(None),
metric='euclidean', min_cluster_size=5, min_samples=None, p=None)
Expand Down
6 changes: 3 additions & 3 deletions hdbscan/hdbscan_.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def hdbscan(
p=2,
leaf_size=40,
algorithm="best",
memory=Memory(cachedir=None, verbose=0),
memory=Memory(None, verbose=0),
approx_min_span_tree=True,
gen_min_span_tree=False,
core_dist_n_jobs=4,
Expand Down Expand Up @@ -726,7 +726,7 @@ def hdbscan(

# Python 2 and 3 compliant string_type checking
if isinstance(memory, str):
memory = Memory(cachedir=memory, verbose=0)
memory = Memory(memory, verbose=0)

size = X.shape[0]
min_samples = min(size - 1, min_samples)
Expand Down Expand Up @@ -1093,7 +1093,7 @@ def __init__(
p=None,
algorithm="best",
leaf_size=40,
memory=Memory(cachedir=None, verbose=0),
memory=Memory(None, verbose=0),
approx_min_span_tree=True,
gen_min_span_tree=False,
core_dist_n_jobs=4,
Expand Down
4 changes: 2 additions & 2 deletions hdbscan/robust_single_linkage_.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _rsl_boruvka_balltree(X, k=5, alpha=1.0,

def robust_single_linkage(X, cut, k=5, alpha=1.4142135623730951,
gamma=5, metric='euclidean', algorithm='best',
memory=Memory(cachedir=None, verbose=0), leaf_size=40,
memory=Memory(None, verbose=0), leaf_size=40,
core_dist_n_jobs=4, **kwargs):
"""Perform robust single linkage clustering from a vector array
or distance matrix.
Expand Down Expand Up @@ -239,7 +239,7 @@ def robust_single_linkage(X, cut, k=5, alpha=1.4142135623730951,

X = check_array(X, accept_sparse='csr')
if isinstance(memory, str):
memory = Memory(cachedir=memory, verbose=0)
memory = Memory(memory, verbose=0)

if algorithm != 'best':
if algorithm == 'generic':
Expand Down

0 comments on commit ccd8535

Please sign in to comment.