-2

I need a numerical example which demonstrates the working of clustering using CURE algorithm.
https://www.cs.ucsb.edu/~veronika/MAE/summary_CURE_01guha.pdf

Sumant
  • 3
  • 2
  • 6

2 Answers2

1

The pyclustering library has a number of clustering algorithims with examples, and example code on their Github. Here is a link the CURE example.

Googling Cure algorithim example also came up with a fair bit.

Hopefully that helps!

James C
  • 23
  • 3
  • Thank you for the answer. But I need a numerical example(which shows random sampling,calculating distance btn clusters,choosing representatives). – Sumant Dec 11 '17 at 04:40
0

Using pyclustering library you can extract information about representatives points and means using corresponding methods (link to CURE pyclustering generated documentation):

# create instance of the algorithm
cure_instance = cure(<algorithm parameters>);

# start processing
cure_instance.process();

# get allocated clusteres
clusters = cure_instance.get_clusters();

# get representative points
representative = cure_instance.get_representors();

Also you can modify source code of the CURE algorithm to display changes after each step, for example, print them to console or even visualize. Here is an example how to modify code to display changes on each step clustering (after line 219) where star means representative point, small points - points itself and big points - means:

# New cluster and updated clusters should relocated in queue
self.__insert_cluster(merged_cluster);
for item in cluster_relocation_requests:
    self.__relocate_cluster(item);
#
# ADD FOLLOWING PEACE OF CODE TO DISPLAY CHANGES ON EACH STEP
#
temp_clusters = [ cure_cluster_unit.indexes for cure_cluster_unit in self.__queue ];
temp_representors = [ cure_cluster_unit.rep for cure_cluster_unit in self.__queue ];
temp_means = [ cure_cluster_unit.mean for cure_cluster_unit in self.__queue ];

visualizer = cluster_visualizer();
visualizer.append_clusters(temp_clusters, self.__pointer_data);

for cluster_index in range(len(temp_clusters)):
    visualizer.append_cluster_attribute(0, cluster_index, temp_representors[cluster_index], '*', 7);
    visualizer.append_cluster_attribute(0, cluster_index, [ temp_means[cluster_index] ], 'o');

visualizer.show();

You will see sequence of images, something like that: enter image description here

Thus, you can display any information that you need.

Also I would like to add that you can use C++ implementation of the algorithm for visualization (that is also part of pyclustering): https://github.com/annoviko/pyclustering/blob/master/ccore/src/cluster/cure.cpp

annoviko
  • 136
  • 4