- kmedoids: https://www.mathworks.com/help/releases/R2021a/stats/kmedoids.html
- pdist2: https://www.mathworks.com/help/releases/R2021a/stats/pdist2.html
- Kmeans algorithm for mixed features: https://www.mathworks.com/matlabcentral/fileexchange/53489-amjams-mixed_kmeans
k medoid with heterogene data( numerik,binar ,nominal)
조회 수: 2 (최근 30일)
이전 댓글 표시
i have a matrix data(nominal und numerik) D(suppose that 3 nominal value,2 numerik value ) und i wat to use k medoid . which distance will be used in k medoid??
idx=k-medoids(D,4,'distance',@(x,y) pdist2(x(:,1:3),y(:,1:3),'hamming')+pdist2(X(:,(4:5),Y(:4,5),'euclidean'))
its korrekt?
댓글 수: 0
답변 (1개)
Prasanna
2025년 2월 28일
Hi Peka,
It is my understanding that you are trying to apply the k-medoids clustering algorithm to a dataset that contains both nominal and numeric data. To perform the same, ensure that the input data numeric matrix to the ‘kmedoids’ function is numeric data where the rows of X correspond to observations, and the columns correspond to variables.
Your approach to use a custom distance function that combines Hamming and Euclidean distances is a reasonable way to handle mixed data types. Here, Hamming distance can be used for nominal data and Euclidian distance can be used for numeric data.
For more information regarding the above, refer to the following documentations:
Hope this helps!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!