@@ -716,8 +716,8 @@ class AgglomerativeClustering(ClusterMixin, BaseEstimator):
716716 the full tree. It must be ``True`` if ``distance_threshold`` is not
717717 ``None``. By default `compute_full_tree` is "auto", which is equivalent
718718 to `True` when `distance_threshold` is not `None` or that `n_clusters`
719- is inferior to 100 or `0.02 * n_samples`. Otherwise, "auto" is
720- equivalent to `False`.
719+ is inferior to the maximum between 100 or `0.02 * n_samples`.
720+ Otherwise, "auto" is equivalent to `False`.
721721
722722 linkage : {"ward", "complete", "average", "single"}, default="ward"
723723 Which linkage criterion to use. The linkage criterion determines which
@@ -924,39 +924,41 @@ class FeatureAgglomeration(AgglomerativeClustering, AgglomerationTransform):
924924
925925 Parameters
926926 ----------
927- n_clusters : int or None, optional ( default=2)
927+ n_clusters : int, default=2
928928 The number of clusters to find. It must be ``None`` if
929929 ``distance_threshold`` is not ``None``.
930930
931- affinity : string or callable, default " euclidean"
931+ affinity : str or callable, default=' euclidean'
932932 Metric used to compute the linkage. Can be "euclidean", "l1", "l2",
933933 "manhattan", "cosine", or 'precomputed'.
934934 If linkage is "ward", only "euclidean" is accepted.
935935
936- memory : None, str or object with the joblib.Memory interface, optional
936+ memory : str or object with the joblib.Memory interface, default=None
937937 Used to cache the output of the computation of the tree.
938938 By default, no caching is done. If a string is given, it is the
939939 path to the caching directory.
940940
941- connectivity : array-like or callable, optional
941+ connectivity : array-like or callable, default=None
942942 Connectivity matrix. Defines for each feature the neighboring
943943 features following a given structure of the data.
944944 This can be a connectivity matrix itself or a callable that transforms
945945 the data into a connectivity matrix, such as derived from
946946 kneighbors_graph. Default is None, i.e, the
947947 hierarchical clustering algorithm is unstructured.
948948
949- compute_full_tree : bool or 'auto', optional, default "auto"
950- Stop early the construction of the tree at n_clusters. This is
951- useful to decrease computation time if the number of clusters is
952- not small compared to the number of features. This option is
953- useful only when specifying a connectivity matrix. Note also that
954- when varying the number of clusters and using caching, it may
955- be advantageous to compute the full tree. It must be ``True`` if
956- ``distance_threshold`` is not ``None``.
949+ compute_full_tree : 'auto' or bool, optional, default='auto'
950+ Stop early the construction of the tree at n_clusters. This is useful
951+ to decrease computation time if the number of clusters is not small
952+ compared to the number of features. This option is useful only when
953+ specifying a connectivity matrix. Note also that when varying the
954+ number of clusters and using caching, it may be advantageous to compute
955+ the full tree. It must be ``True`` if ``distance_threshold`` is not
956+ ``None``. By default `compute_full_tree` is "auto", which is equivalent
957+ to `True` when `distance_threshold` is not `None` or that `n_clusters`
958+ is inferior to the maximum between 100 or `0.02 * n_samples`.
959+ Otherwise, "auto" is equivalent to `False`.
957960
958- linkage : {"ward", "complete", "average", "single"}, optional\
959- (default="ward")
961+ linkage : {'ward', 'complete', 'average', 'single'}, default='ward'
960962 Which linkage criterion to use. The linkage criterion determines which
961963 distance to use between sets of features. The algorithm will merge
962964 the pairs of cluster that minimize this criterion.
@@ -969,12 +971,12 @@ class FeatureAgglomeration(AgglomerativeClustering, AgglomerationTransform):
969971 - single uses the minimum of the distances between all observations
970972 of the two sets.
971973
972- pooling_func : callable, default np.mean
974+ pooling_func : callable, default= np.mean
973975 This combines the values of agglomerated features into a single
974976 value, and should accept an array of shape [M, N] and the keyword
975977 argument `axis=1`, and reduce it to an array of size [M].
976978
977- distance_threshold : float, optional ( default=None)
979+ distance_threshold : float, default=None
978980 The linkage distance threshold above which, clusters will not be
979981 merged. If not ``None``, ``n_clusters`` must be ``None`` and
980982 ``compute_full_tree`` must be ``True``.
@@ -988,7 +990,7 @@ class FeatureAgglomeration(AgglomerativeClustering, AgglomerationTransform):
988990 ``distance_threshold=None``, it will be equal to the given
989991 ``n_clusters``.
990992
991- labels_ : array-like, (n_features,)
993+ labels_ : array-like of (n_features,)
992994 cluster labels for each feature.
993995
994996 n_leaves_ : int
@@ -997,15 +999,15 @@ class FeatureAgglomeration(AgglomerativeClustering, AgglomerationTransform):
997999 n_connected_components_ : int
9981000 The estimated number of connected components in the graph.
9991001
1000- children_ : array-like, shape (n_nodes-1, 2)
1002+ children_ : array-like of shape (n_nodes-1, 2)
10011003 The children of each non-leaf node. Values less than `n_features`
10021004 correspond to leaves of the tree which are the original samples.
10031005 A node `i` greater than or equal to `n_features` is a non-leaf
10041006 node and has children `children_[i - n_features]`. Alternatively
10051007 at the i-th iteration, children[i][0] and children[i][1]
10061008 are merged to form node `n_features + i`
10071009
1008- distances_ : array-like, shape (n_nodes-1,)
1010+ distances_ : array-like of shape (n_nodes-1,)
10091011 Distances between nodes in the corresponding place in `children_`.
10101012 Only computed if distance_threshold is not None.
10111013
0 commit comments