sklearn.cluster.cluster_optics_xi¶
sklearn.cluster.cluster_optics_xi(*, reachability, predecessor, ordering, min_samples, min_cluster_size=None, xi=0.05, predecessor_correction=True)
根据Xi-steep方法自动提取群集。
| 参数 | 说明 |
|---|---|
| reachability | array, shape (n_samples,) OPTICS计算的可达距离( reachability_) |
| predecessor | array, shape (n_samples,) OPTICS计算的前任 |
| ordering | array, shape (n_samples,) OPTICS排序了点的索引( ordering_) |
| min_samples | int > 1 or float between 0 and 1 与OPTICS中的 min_samples相同。上下陡峭地区不能有超过min_samples的连续非陡峭点。表示为样本数的绝对值或分数(四舍五入至少为2) |
| min_cluster_size | int > 1 or float between 0 and 1 (default=None) OPTICS聚类中的最小样本数。表示为样本数的绝对值或分数(四舍五入至少为2)。如果为 None,则使用min_samples的值。 |
| xi | float, between 0 and 1, optional (default=0.05) 确定构成聚类边界的可达性图的最小陡度。例如,可达图中的一个向上点定义为从一个点到它的后继点最多为1-xi的比率。 |
| predecessor_correction | bool, optional (default=True) 基于计算前人的正确聚类 |
| 返回值 | 说明 |
|---|---|
| labels | array, shape (n_samples) 分配给样品的标签。不包含在任何聚类中的点被标记为-1。 |
| clusters | array, shape (n_clusters, 2) 每一行中 [start,end]形式的聚类列表,包括所有索引。聚类是根据(end, -start)(升序)排列的,因此包含较小簇的更大的簇在这种嵌套的较小的簇之后。因为label没有反映层次结构,所以通常是len(clusters) > np.unique(labels)。 |



