Re: Clustering using kmeans algorithm
Peter Reutemann <[email protected]> Thu, 20 Apr 2023 11:00:07 +1200
| Newsgroups | gmane.comp.ai.weka |
|---|---|
| Message-ID | <CAHoQ12JB0OnNSDjeU48WJqBPFfcxZd5Yy81kQjFjEVcTWCSu6w@mail.gmail.com> |
> I am trying to utilize the simple k-means algorithm to create a > clustering model > > The data set is a series of records each containing 5 consecutive > numerical price values e.g. 1.30965, 1.30979, 1,31008, 1,31020, 1,32045 > > I am setting k = 25 for the number of clusters > > When I run the clustering algorithm the result shows the 25 clusters but > they are based solely on the average price level of the 5 data input points That's what kmeans does. You tell it to separate the data into 25 sub-groups and it then computes the means for each attribute in these groups. SimpleKMeans is not necessarily a good approach when you don't know how many clusters are actually in the data. It will always generate as many as requested, whether they make sense or not. If your data contains 3 clusters (eg the iris dataset with three distinct flower clusters) and you tell SimpleKMeans to give you 25 it will do that. > What I am seeking is clustering that reflects the graph of the various 5 > input data prices > > e.g. if the five price input data values increase steadily, I wish one > of the clusters to reflect that sort of increasing graph > > On the other hand, for example, the graph of the 5 input data prices may > look live a 'v' - decreasing, then increasing > > I am seeking another cluster of data inputs that reflects that type of graph > > How do I do this in weka please ? Have you tried the EM cluster algorithm? It has a mode that attempts to find a suitable number of clusters by itself (takes a while). Also, since you have a timeseries of prices (and it looks like you might want to predict future ones), have you thought about using the timeseries package in Weka instead of clustering? Cheers, Peter -- Peter Reutemann Dept. of Computer Science University of Waikato, Hamilton, NZ Mobile +64 22 190 2375 https://www.cs.waikato.ac.nz/~fracpete/ http://www.data-mining.co.nz/ _______________________________________________ Wekalist mailing list -- [email protected] Send posts to [email protected] To unsubscribe send an email to [email protected] To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html