k medoid with heterogene data( numerik,binar ,nominal)

4 visualizzazioni (ultimi 30 giorni)
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?

Risposte (1)

Prasanna
Prasanna il 28 Feb 2025
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!

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!