K-means Clustering
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, I am trying to do a un-supervised classification on IMU data.
I have a raw data file of variables like accleration(x,y,z), gyro(x,y,z) etc (in total 15 coloums).
When I apply
opts = statset('Display','final');
idx = kmeans(DataUnsup,NoOfClassesUnsup,'Distance','correlation','Replicates',NoOfIterations,'Options',opts);
[sizeFullData,~] = size(DataUnsup);
T=1:sizeFullData;
plot(T',idx,'g+');
I am NOT getting a good clustering. This is raw data which is a file containing data of all movements like walk, run, sit, stand etc recoreded together in one go. There is no information of the grouping or order of the data. DataUnsup usually consists of a mixture of the different 15 variables, if not all.
Can someone please guide me?
Avishek
P.S. sqeuclidean, cosine etc are also not working.
0 Kommentare
Antworten (2)
Walter Roberson
am 7 Jun. 2012
What you write suggests that kmeans is not a good classifier for you to use.
2 Kommentare
Peter Perkins
am 7 Jun. 2012
Avishek, it's not clear what you mean by "NOT getting a good clustering". If I understand your code correctly, you are plotting the cluster number of each row in the data vs. its row number. Unless the data are already in a special order, there's no reason why you would expect to see anything other than a big jumble of points along discrete horizontal lines. Perhaps you are seeing one big jumble and a bunch of (near) singletons and observing that you have no useful clusters. Perhaps your description was intended to mean that the data are in some special order, and you are just testing whether or not kmeans can recreate it. I can't tell.
Two things:
- The silhouette function may prove useful to visualize whether or not kmeans found "good" clusters.
- You're using correlation distance which will only be useful for a very particular kind of data. I don't know anything about your data, so you may have a good reason for using correlation. You do say you tried squared euclidean and cosine distance, so perhaps correlation distance was just your last try at getting something to work.
Hope this helps.
2 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!