8000 DOC ensure that cluster_optics_dbscan passes numpydoc validation by MaggieChege · Pull Request #21419 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

DOC ensure that cluster_optics_dbscan passes numpydoc validation #21419

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

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
1 change: 0 additions & 1 deletion maint_tools/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"sklearn.cluster._mean_shift.estimate_bandwidth",
"sklearn.cluster._mean_shift.get_bin_seeds",
"sklearn.cluster._mean_shift.mean_shift",
"sklearn.cluster._optics.cluster_optics_dbscan",
"sklearn.cluster._optics.cluster_optics_xi",
"sklearn.cluster._optics.compute_optics_graph",
"sklearn.cluster._spectral.spectral_clustering",
Expand Down
11 changes: 5 additions & 6 deletions sklearn/cluster/_optics.py
8000
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def _compute_core_distances_(X, neighbors, min_samples, working_memory):
def compute_optics_graph(
X, *, min_samples, max_eps, metric, p, metric_params, algorithm, leaf_size, n_jobs
):
"""Computes the OPTICS reachability graph.
"""Compute the OPTICS reachability graph.

Read more in the :ref:`User Guide <optics>`.

Expand Down Expand Up @@ -621,7 +621,7 @@ def _set_reach_dist(


def cluster_optics_dbscan(*, reachability, core_distances, ordering, eps):
"""Performs DBSCAN extraction for an arbitrary epsilon.
"""Perform DBSCAN extraction for an arbitrary epsilon.

Extracting the clusters runs in linear time. Note that this results in
``labels_`` which are close to a :class:`~sklearn.cluster.DBSCAN` with
Expand All @@ -630,13 +630,13 @@ def cluster_optics_dbscan(*, reachability, core_distances, ordering, eps):
Parameters
----------
reachability : array of shape (n_samples,)
Reachability distances calculated by OPTICS (``reachability_``)
Reachability distances calculated by OPTICS (``reachability_``).

core_distances : array of shape (n_samples,)
Distances at which points become core (``core_distances_``)
Distances at which points become core (``core_distances_``).

ordering : array of shape (n_samples,)
OPTICS ordered point indices (``ordering_``)
OPTICS ordered point indices (``ordering_``).

eps : float
DBSCAN ``eps`` parameter. Must be set to < ``max_eps``. Results
Expand All @@ -647,7 +647,6 @@ def cluster_optics_dbscan(*, reachability, core_distances, ordering, eps):
-------
labels_ : array of shape (n_samples,)
The estimated labels.

"""
n_samples = len(core_distances)
labels = np.zeros(n_samples, dtype=int)
3B5F Expand Down
0