首页 > 其他分享 >AgglomerativeClustering

AgglomerativeClustering

时间:2023-12-02 18:46:08浏览次数:37  
标签:None compute AgglomerativeClustering threshold clusters 默认值

AgglomerativeClustering 层次聚类

from sklearn.cluster import AgglomerativeClustering

AgglomerativeClustering ←官方网页的函数说明

一、参数说明

class sklearn.cluster.AgglomerativeClustering(n_clusters=2, *, 
    affinity='deprecated', 
    metric=None, 
    memory=None, 
    connectivity=None, 
    compute_full_tree='auto', 
    linkage='ward', 
    distance_threshold=None, 
    compute_distances=False)

 

  • n_clusters: int or None, 默认值=2
    簇的个数,如果参数distance_threshold 的值不是None,则n_clusters 必须给None
  • affinity: str or callable, 默认值='euclidean'
    s
  • metricstr or callable, 默认值=None
    s
  • memorystr or object with the joblib.Memory interface, 默认值=None
    s
  • connectivityarray-like or callable, 默认值=None
    s
  • compute_full_tree'auto' or bool, 默认值='auto'
    s
  • linkage{'ward', 'complete', 'average', 'single'}, 默认值='ward'
    选择使用链接的准则。链接的准则决定了观测集之间使用的距离。该算法将合并使该准则最小化的簇。
    • 'ward' 最小化被合并簇的方差。

    • 'average' 使用两个簇的每次观测距离的平均值。

    • 'complete' or 'maximum' 使用两个簇的最大距离值。

    • 'single' 使用两个簇的最小距离值。

   New in version 0.20: Added the 'single' option

  • distance_thresholdfloat, 默认值=None
    大于或等于距离阈值的簇不合并。如果不是None,则n_clusters 必须为None, compute_full_tree 必须为True
    New in version 0.21.
  • compute_distancesbool, 默认值=False
    即使不使用distance_threshold 时,也计算簇之间的距离。这可以用于树形图可视化,但会带来计算和内存开销。
    New in version 0.24.

 

标签:None,compute,AgglomerativeClustering,threshold,clusters,默认值
From: https://www.cnblogs.com/paramotor/p/17872009.html

相关文章