Jaya has asked for the wisdom of the Perl Monks concerning the following question:

I would like to know if there is any module to perform complete-linkage clustering for a very large distance matrix.

Edit by BazB: remove excess code tags.

Replies are listed 'Best First'.
Re: Complete Linkage Clustering
by kvale (Monsignor) on Feb 27, 2005 at 01:05 UTC
    For complete linkage clustering and other hierarchical clustering methods, check out Algorithm::Cluster, a Perl binding to the C Cluster library.

    -Mark

      Thank You!
      I have installed the Algorithm::Cluster module. I have a very large distance matrix to solve. The function Algorithm::Cluster::treecluster(%param) seems to cluster genes or microarray.

      %param=( data => \@m, #Wanted array reference, but got a #reference to . mask =>'', #Parameter 'mask' is not a valid #matrix, ignoring it. weight =>'', #Parameter 'weight' does not point #to an array, ignoring it. transpose = '', #Parameter 'transpose' must be #either 0 or 1 (got '') )

      I have stated the errors against its corresponding statements.

      Any suggestion? Thanks

      Edit by BazB: remove excess code tags.

        Hmmm... usually folks ask questions about why their program isn't working. You already seem to understand why it isn't working. I have no idea what "complete linkage clustering" is, but you have already provided the errors above... so fix 'em and you will be on your way. In particular,
        • 'weight' is pointing to an empty string... change it to an array as required.
        • 'transpose' is pointing to an empty string... change it to 0 or 1.
        • 'mask' is pointing to an empty string. Correct that.
        • 'data' seems to be ok... it _is_ pointing to an arrayref... check @m and see if it is what the program expects.
        --
        when small people start casting long shadows, it is time to go to bed
Re: Complete Linkage Clustering
by chanio (Priest) on Feb 27, 2005 at 20:52 UTC
      Thank you. I have managed to get the cluster output. My questions seem trivial. I am bit new to Perl.

      I was wondering if there is any module to represent the cluster output into dendrogram. I checked the search.CPAN to find if there are any modules for graphical representation of the cluster . But I could not find any. They are all for Bioclusters.

      I need to represent the result in graphical form. Since there is a module to obtain the clustering result,is there any module to represent this result in graphical(dendrogram) format?

      ($result, $linkdist) = Algorithm::Cluster::treecluster(%param);

      Thanks for all the help.
Re: Complete Linkage Clustering
by Jaya (Acolyte) on Feb 28, 2005 at 02:17 UTC
    I was wondering if there is any module to represent the cluster output into dendrogram. I checked the search.CPAN to find if there are any modules for graphical representation of the cluster . But I could not find any. They are all for Bioclusters.

    I need to represent the result in graphical form. Since there is a module to obtain the clustering result,is there any module to represent this result in graphical(dendrogram) format?

    ($result, $linkdist) = Algorithm::Cluster::treecluster(%param);

    Thanks for all the help.