0
저는 파이썬에서 Scipy로 clusering하는 것에 대해 다소 혼란 스럽습니다. 여기 내 소스 코드는 다음과 같습니다파이썬에서 Scipy로 클러스터링 하시겠습니까? (계층 적 클러스터링)
import scipy.spatial.distance as dist
import numpy, scipy
dataMatrix = numpy.array(matrix)
distMatrix = dist.pdist(dataMatrix, 'euclidean')
distSquareMatrix = dist.squareform(distMatrix)
Y = scipy.cluster.hierarchy.linkage(distSquareMatrix, method='complete')
나는 'distMatrix'또는 클러스터링을위한 입력으로 squareform 'distSquareMatrix'를 사용해야합니까? 다른 게시물에서 두 가지 방법을 모두 보았 기 때문입니다. 그러나 출력은 다릅니다. 이제는 내가 무엇을 선택해야하는지 잘 모르겠습니다.
답변 해 주셔서 감사합니다. 즉, 연결 함수에서 'distMatrix'를 사용해야한다는 의미입니다 ... – Joko