Skip to content

Commit

Permalink
Updated the documentation on distance_threshold restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
VathsalaAchar committed Aug 7, 2017
1 parent b4bc8bc commit 1c9ad69
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sklearn/cluster/hierarchical.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,9 @@ def _hc_cut(n_clusters, children, n_leaves,
If ``distance_threshold`` is set then ``n_clusters`` will be the
number of clusters at which the distances exceed the
``distance_threshold``
NOTE: You should set either ``n_clusters`` or ``distance_threshold``,
NOT both. If the ``distance_threshold`` is set then ``n_clusters`` is
ignored.
distances : ndarray, shape (n_nodes-1,) (optional)
Only used when distance_threshold is set.
Expand Down Expand Up @@ -626,7 +629,8 @@ class AgglomerativeClustering(BaseEstimator, ClusterMixin):
distance_threshold : int (optional)
The distance threshold to cluster at.
NOTE: You should set either ``n_clusters`` or ``distance_threshold``,
NOT both.
NOT both. If the ``distance_threshold`` is set then ``n_clusters`` is
ignored.
affinity : string or callable, default: "euclidean"
Metric used to compute the linkage. Can be "euclidean", "l1", "l2",
Expand Down Expand Up @@ -829,7 +833,8 @@ class FeatureAgglomeration(AgglomerativeClustering, AgglomerationTransform):
distance_threshold : int (optional)
The distance threshold to cluster at.
NOTE: You should set either ``n_clusters`` or ``distance_threshold``,
NOT both.
NOT both. If the ``distance_threshold`` is set then ``n_clusters`` is
ignored.
affinity : string or callable, default "euclidean"
Metric used to compute the linkage. Can be "euclidean", "l1", "l2",
Expand Down

0 comments on commit 1c9ad69

Please sign in to comment.