Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a positional argument for the cachedir/location #563

Merged
merged 1 commit into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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