in reply to Re: RFC: Fuzzy Clustering with Perl
in thread RFC: Fuzzy Clustering with Perl

You might want to encapsulate the code under a sub, where one of parameters will be the distance function name. Other parameters could also be named parameter, as well. This is a very widely spread perl technique. For example, this sub would be called then as
my $result = cluster( num_clusters => 5, data => [1,2,3,4,5], distance => 'procrustes' );
This way, if the programmer does not specify all parameters, there will be subsituted sensible defaults ( possibly different for each distance ). Also the sub can die if there's not enough or invalid parameters given.

Replies are listed 'Best First'.
Re^3: RFC: Fuzzy Clustering with Perl
by lin0 (Curate) on Nov 07, 2006 at 14:42 UTC

    Hi dk

    Thanks for the pointer. Now, I am working on a new version of the script. I will have it ready this weekend. I hope you could have a look at it and make some comments

    Cheers!

    lin0