-1
私は米国のデータに対してセグメンテーションを実行しました。同様のクラスタ割り当てを他の市場に(開始ソリューションとして)どのように適用できますか?米国と他の市場は同じ正確なインプットと調査をしています。開始ソリューションを使用しているHclust
ここに私のコードは次のとおりです。
TwoStepCluster <-function(xdata, k, method="ward.D2", factor=FALSE) {
if (factor==TRUE) {
xdata=PCA(xdata,k)
}
if (method == "mclust") {
start = Mclust(xdata,4)$classification
cen = capply(xdata, start)
} else if (method != "none") {
d = dist(xdata)
hcstart = cutree(hclust(d, method = method), k)
cen = capply(xdata, hcstart)
} else {cen=k}
km = kmeans(xdata, cen, iter.max=100)
return(as.matrix(km$cluster))
}
hclustのいずれかのオプションがありますまたは関数kmeansは、そうするために機能しますか?
ありがとうございます!