R語言
xclara
位於 cluster
包(package)。 說明
一個人工數據集,由 3 個 well-separated 簇中的 3000 個點組成。
用法
data(xclara)
格式
一個 DataFrame ,對 2 個數值變量(名為 V1
和 V2
)進行 3000 個觀測,分別給出點的 和 坐標。
注意
我們的 xclara
版本比 read.table("xclara.dat")
版本稍微更圓潤,all.equal
測量的相對差異是 1.15e-7
(對於 V1
)和 1.17e-7
(對於 V2
),這表明我們的版本已options(digits = 7)
格式化的結果。
此前(2017 年 5 月之前),據稱這三個簇的大小均為 1000,這顯然是錯誤的。 pam(*, 3)
給出的簇大小為 899、1149 和 952,除了七個 “outliers” (或 “mislabellings”)對應於觀察索引 、 和 ,請參見示例。
例子
## Visualization: Assuming groups are defined as {1:1000}, {1001:2000}, {2001:3000}
plot(xclara, cex = 3/4, col = rep(1:3, each=1000))
p.ID <- c(78, 1411, 2535) ## PAM's medoid indices == pam(xclara, 3)$id.med
text(xclara[p.ID,], labels = 1:3, cex=2, col=1:3)
px <- pam(xclara, 3) ## takes ~2 seconds
cxcl <- px$clustering ; iCl <- split(seq_along(cxcl), cxcl)
boxplot(iCl, range = 0.7, horizontal=TRUE,
main = "Indices of the 3 clusters of pam(xclara, 3)")
## Look more closely now:
bxCl <- boxplot(iCl, range = 0.7, plot=FALSE)
## We see 3 + 2 + 2 = 7 clear "outlier"s or "wrong group" observations:
with(bxCl, rbind(out, group))
## out 1038 1451 1610 30 327 562 770
## group 1 1 1 2 2 3 3
## Apart from these, what are the robust ranges of indices? -- Robust range:
t(iR <- bxCl$stats[c(1,5),])
## 1 900
## 901 2050
## 2051 3000
gc <- adjustcolor("gray20",1/2)
abline(v = iR, col = gc, lty=3)
axis(3, at = c(0, iR[2,]), padj = 1.2, col=gc, col.axis=gc)
來源
示例數據集附有以下參考文獻(文件‘xclara.dat' 裏麵 'clus_examples.tar.gz’)。
參考
Anja Struyf, Mia Hubert & Peter J. Rousseeuw (1996) Clustering in an Object-Oriented Environment. Journal of Statistical Software 1. doi:10.18637/jss.v001.i04
相關用法
- R summary.clara “clara”對象的摘要方法
- R diana 分裂分析聚類
- R pluton 鈈同位素成分批次
- R votes.repub 總統選舉中共和黨候選人的投票
- R agnes 凝聚嵌套(層次聚類)
- R print.mona MONA 對象的打印方法
- R print.clara CLARA 對象的打印方法
- R mona 二元變量的單論分析聚類
- R plot.diana 分裂層次聚類圖
- R plot.mona 一元分裂層次聚類的旗幟
- R bannerplot 繪圖橫幅(層次聚類)
- R plot.partition 數據集分區圖
- R summary.agnes “agnes”對象的摘要方法
- R pltree 繪製層次聚類的聚類樹
- R summary.mona “mona”對象的摘要方法
- R plantTraits 植物物種性狀數據
- R plot.agnes 凝聚層次聚類圖
- R print.agnes AGNES 對象的打印方法
- R chorSub Kola 數據 C 範圍的子集
- R pam 圍繞 Medoid 進行分區
- R volume.ellipsoid 計算(橢球體的)體積
- R clusplot (分區對象的)雙變量聚類圖
- R print.pam PAM 對象的打印方法
- R clara 集群大型應用程序
- R agnes.object 聚合嵌套 (AGNES) 對象
注:本文由純淨天空篩選整理自R-devel大神的英文原創作品 Bivariate Data Set with 3 Clusters。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。