Dear All,
hope this message finds you well.
I want to ask about the the implementation of the Fixed-width clustering algorithm.
anyone can help me ASAP?
Fixed-width clustering algorithm:
Fixed width clustering creates a set of clusters
of fixed radius (width) w. Here the width w is a parameter to
be specified by the user. First, a data vector is taken and used as
the centroid (center) of the first cluster with radius w. Then for
each subsequent data vector the Euclidean distance between the
centroid of the current clusters and this data vector is computed. If
the distance to the closest cluster center from the data vector is less
than the radius w, the data vector is added into that cluster and the
centroid of that cluster is adjusted to the mean of the data vectors
it contains. If the distance to the closest cluster center is more than
the radius w, then a new cluster is formed with that data vector as
the centroid. This operation produces a set of disjoint, fixed width
(radius of w) clusters in the feature space.
Thanks in advance
Loading
VulpesRank #55 · 29.2K reputationPosted May 19, 2011, 6:30 AM EDT
> clusters = new List
>();
VulpesRank #55 · 29.2K reputationPosted May 18, 2011, 2:58 AM EDT
Please see my article (http://www.c-sharpcorner.com/UploadFile/b942f9/6167/) for an implementation of the latter which you may be able to adjust if it's not quite what you want.
Aqua21 reputationPosted May 19, 2011, 12:00 AM EDT
Yes I saw it, it is perfect. but I want the the Fixed width clustering :)
I want the data to read from the Database, it is a stream data, i.e. it is sensor readings. To be exact, it is a temperature readings from sensor devices.
The Fixed width clustering algorithm will be performed on these data to detect the outliers value in these data.
thank you for your cooperation & understanding
Aqua21 reputationPosted May 22, 2011, 5:42 AM EDT
Firstly, I appreciate your effort and time and would like to thank you very much, really it is perfect it is what I want .
Secondly, I want to ask some questions if you don't mind:
Sorry for the inconvenience and thank you for your cooperation.
VulpesRank #55 · 29.2K reputationPosted May 22, 2011, 9:40 AM EDT
Aqua21 reputationPosted May 23, 2011, 3:58 AM EDT
Aqua21 reputationPosted May 30, 2011, 4:51 AM EDT
VulpesRank #55 · 29.2K reputationPosted May 30, 2011, 5:45 AM EDT
> clusters = new List
>();
Aqua21 reputationPosted May 30, 2011, 5:53 AM EDT
Aqua21 reputationPosted May 30, 2011, 6:05 AM EDT
then: centroids[j] = GetCentroid(clusters[j]) will be centroids[i] + centroids[j] / 2
is this right?
VulpesRank #55 · 29.2K reputationPosted May 30, 2011, 6:30 AM EDT
centroids[j] = (centroids[i] + centroids[j])/ 2.0;
However, you'll have some problems if you need to process that cluster again as the centroid won't coincide with the reality of the situation.
Aqua21 reputationPosted May 31, 2011, 12:05 AM EDT
VulpesRank #55 · 29.2K reputationPosted May 31, 2011, 3:30 AM EDT
Aqua21 reputationPosted Jun 5, 2011, 2:45 AM EDT
Aqua21 reputationPosted Jun 6, 2011, 4:37 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jun 6, 2011, 10:44 AM EDT
Aqua21 reputationPosted Jul 22, 2011, 3:32 PM EDT
I want to save in addition the sensor ID with the tempreture value, which means when I said that this value is outlier I want to know it comes from which sensor. For ex. when the value 80 is outlier, I want to know that it comes from sensor no. 1.
what is the more suitable data type, is it the class? where it contains the tempreture value & the sensor ID.
this means that I need a list of classes. is it right?
I want to edit the fixed-width algorithm & the merge algorithm to fit my need. is it possible?? and how can I fix it?
Many Thanks
VulpesRank #55 · 29.2K reputationPosted Jul 23, 2011, 4:31 AM EDT
It's not difficult to change it. Here's the code:
> clusters = new List
>();
VulpesRank #55 · 29.2K reputationPosted Jul 28, 2013, 12:18 PM EDT
1. You want to cluster 1 particular field of the class (say src) as was done with the temperature field in the previous posts; or
2. You want to cluster all 9 fields of the class, giving them equal weightings, using a 9-dimensional Euclidean distance function?
VulpesRank #55 · 29.2K reputationPosted Jul 29, 2013, 3:46 PM EDT
The following is very rushed so watch out for bugs:
> clusters = new List
>();
VulpesRank #55 · 29.2K reputationPosted Jul 30, 2013, 12:41 AM EDT
'data' is a List
VulpesRank #55 · 29.2K reputationPosted Jul 30, 2013, 4:34 AM EDT
VulpesRank #55 · 29.2K reputationPosted Aug 1, 2013, 10:36 AM EDT
I'd imagine that the final results won't be much different than if you'd clustered the objects in the original order.
VulpesRank #55 · 29.2K reputationPosted Aug 1, 2013, 11:47 AM EDT
Rather than wrap the List
It also contains a Centroid property which returns a Flow representing the centroid of the Cluster.
Again, it's very rushed so keep an eye out for bugs:
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts