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)。 |
