Borrar filtros
Borrar filtros

id in the kmeans function

2 visualizaciones (últimos 30 días)
Fredrik Scheie
Fredrik Scheie el 11 de Sept. de 2021
Editada: Image Analyst el 12 de Sept. de 2021
[id,C,SUMD]= kmeans(Dataset,3);
[3:43 PM]
I understand the C refers to the centroid, SumD which is set to the squared euclidean distance by default, but I am unsure as to what id does? I tried finding the documentation where it says idx (which I assume is the same as id) gives the cluster indices, so does that mean that it numerates the clusters somehow?

Respuesta aceptada

Image Analyst
Image Analyst el 12 de Sept. de 2021
Editada: Image Analyst el 12 de Sept. de 2021
id is the class identification number that kmeans() thinks each of your data rows best belongs to. So it you had, say 1000 points and told it to assume 3 clusters (classes), then kmeans will classify each of your data rows into one of the 3 clusters (classes) and return id, which will be a column vector of 1000 rows where each value is either 1, 2, or 3 depending on what cluster/class number it thinks that particular data point most likely belongs to.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by