Subscribe to DSC Newsletter

Very short and simple source code to produce nice simulated cluster structures (stored in a text file called cluster.txt) and test cluster detection algorithms. The version below is written in Perl, and here's an example of output with 3 simulated clusters:

`rm cluster.txt`;


sub seed {

local($x,$y)[email protected]_;
#print "==$x == $y\n";

for ($k=0; $k<$kmax; $k++) {

for ($k=0; $k<$kmax; $k++) {
print OUT "$cluster\t$px[$k]\t$py[$k]\n";


Views: 3805

Replies to This Discussion

Similar code in PHP attached to this comment.



On Data Science Central

© 2021   TechTarget, Inc.   Powered by

Badges  |  Report an Issue  |  Privacy Policy  |  Terms of Service