Question: How can I get clusters from distance matrix, using PHP?

Question

How can I get clusters from distance matrix, using PHP?

Answers 0
Added at 2017-11-30 17:11
Tags
Question

I have distance matrix as two-dimensional array, like this:

distance matrix

So, I need to find clusters, of elements with its help. I can do it, using hierarchic clusterization, like k-means. I have found such example here PHP K-Means

How can I convert my two-dimensional array into array of points, listed in this example?

$points = [
[80,55],[86,59],[19,85],[41,47],[57,58],
[76,22],[94,60],[13,93],[90,48],[52,54],
[62,46],[88,44],[85,24],[63,14],[51,40],
[75,31],[86,62],[81,95],[47,22],[43,95],
[71,19],[17,65],[69,21],[59,60],[59,12],
[15,22],[49,93],[56,35],[18,20],[39,59],
[50,15],[81,36],[67,62],[32,15],[75,65],
[10,47],[75,18],[13,45],[30,62],[95,79],
[64,11],[92,14],[94,49],[39,13],[60,68],
[62,10],[74,44],[37,42],[97,60],[47,73],
];
Answers to

How can I get clusters from distance matrix, using PHP?

Source Show
◀ Wstecz