25 Data clustering

There are several examples related to cluster algorithms in the directory ''macros/examples''. The Jython macros start with ''clustering*''. The data clustering is based the JMinHEP packagehttp://hepforge.cedar.ac.uk/jminhep/ java library and includes:

In short, first one should create a data container ``DataHolder'' to keep a multidimensional data. (note: P1D can only data for two dimensions, in X and Y). One can display this container and export to a table as:

>>> from jminhep.cluster import *
>>> data = DataHolder("Example")  # create a container
>>> ....                          # fill this container using add method
>>> HTable(data)                  # look at this container in a table
>>> c1=HPlot()                    # create a canvas to display the data
>>> p1=P1D(data,0,1)              # export to P1D to display 1st and 2nd column
>>> c1.draw(p1)                   # draw it  in a canvas
>>> c1.visible(1)
>>> #### now do some clustering ###
>>> pat = Partition(data)         # fill  partitioner
>>> pat.set(3, 0.001, 1.7, 1000)  # initialize the clustering
>>>                               # (reconstruct 3 clusters etc..)
>>> pat.run(131)                  # run the clustering algorithm (Fuzzy)

Read JMinHEP APIhttp://hepforge.cedar.ac.uk/jminhep/html/jminhep/cluster/package-summary.html for more information and try to run the examples in ''macros/examples'' directory