How do I do K-Means clustering to multi dimensional data? How do I create multi dimensional data by sampling it from a scalar array at 5 samples each?

6 views (last 30 days)
Hello,
I'll describe my problem statement below.
I have a problem wherein I have to generate multidimensional data from a scalar array at 5 samples each, for eg. I will take the first five samples (elements if you may) of the scalar array and consider them coordinates to a five dimensional point.
I create such a 5D vector and then do k-means clustering to it.
My question is how do I approach this problem? I dont know how I would model a five dimensional point until I know how I'll do the k-means structuring.
I had modeled the point using a structure with the definition of the structure having 5 variables for the coordinates and one variable for the classifier value of that point.
I ran it through the code for the k-means I created( initial values of centroids, classify points with them, update centroids with new mean, repeat till convergence which I've assumed is when the distortion values differs from its previous value by a certain number)
I got the program to run, but all the points are classified to the same class(which is impossible), this means my logic is incorrect, which also means my approach was completely off track.
So please if you would, answer these two questions,
1) How do you convert a scalar array into a five dimensional data?
2) Is there an inbuilt function in matlab which could help me handle five dimensional k-means? If yes, can I somehow also check the validity of the k means?
I am literally pulling my hair at this point and if someone could kindly shed some light on this problem it would be a great help?

Answers (0)

Community Treasure Hunt

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

Start Hunting!