I am attempting to cluster a large amount of pair-wise data that represent coordinates in a symmetrical matrix where each element in the matrix represents a “similarity” value between the two data pairs. I have to cluster the data when the value is greater than 60.
Lets pretend there are 10 pieces of data (0 through 9). So, the matrix would have 100 elements. I already wrote a program that extracts the coordinates and corresponding values of the matrix when this value is greater than 60. Since the matrix is symmetrical, I only extracted values when Y > X.
| X | Y | Value |
| 0 | 1 | 70 |
| 0 | 2 | 80 |
| 1 | 2 | 60 |
| 1 | 5 | 90 |
| 2 | 3 | 100 |
| 6 | 7 | 90 |
| 7 | 8 | 100 |
So, cluster #1 will be 0,1,2,3,5.
cluster #2 will be 6,7,8
Then I will add in later …
cluster #3 will be 4
cluster #4 will be 9
I am weak on passing information to and from subroutines.
I would like for the data to be in this data structure.
$cluster_60[$cluster_element]{$cluster_key}
So,
$cluster_60[4]{1} = 5
$cluster_60[0]{3} = 4
$cluster_60[1]{2} = 8
I would like to be able to access 5 by simply writing outside of the subroutine
$cluster_60[4]{1}.
Please help me, Perl Monks! Thanks, Clayton
In reply to Pair-Wise Clustering by cutcopy11
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |