I have a 3-dimensional array of integers (~ 4000 x 6000 x 3) that I need to classify in a certain way. I hope for something like the k-mean clustering method, but instead of entering the number of clusters, I would like to enter the maximum radius of the cluster.
On the other hand, given the scope of a certain size, I would like to find the minimum number of non-empty spheres that will cover all the data and classify the points accordingly.
Although I know little about this field, I looked a bit for clustering algorithms and did not find what it did.
For example, given a random data set:
import numpy as np randomArray = np.random.rand(10,10,3)*500 Out[8]: array([[[ 256.68932025, 153.07151992, 196.19477623], [ 48.05542231, 346.1289173 , 327.44694932], [ 427.87340594, 197.26882283, 402.41558648], [ 192.50462233, 408.31800086, 81.66016443], [ 64.15373494, 34.96971099, 446.55362458]], [[ 376.55003794, 70.09514697, 242.08947306], [ 194.86207829, 379.90969257, 439.47043484], [ 102.99922513, 98.57769429, 415.5059223 ], [ 464.65318671, 223.60061654, 417.52758666], [ 53.68383153, 205.32517075, 299.83858164]], [[ 364.80957874, 14.26150931, 264.01568428], [ 295.75617954, 107.52678922, 87.89830525], [ 57.90617865, 409.54132373, 54.36940482], [ 217.35951975, 345.7892723 , 301.07031811], [ 295.98999071, 27.17772152, 182.58776469]], [[ 291.69513153, 466.03218019, 279.25794618], [ 179.60152364, 161.64966386, 269.34221176], [ 374.78609278, 259.18286321, 459.8037004 ], [ 458.51249648, 87.05600447, 268.12588338], [ 152.54500603, 472.36773898, 1.15894726]], [[ 35.43731854, 163.42770568, 131.77683448], [ 14.36039625, 390.33409364, 314.56443073], [ 71.47211566, 109.78613335, 345.57021076], [ 74.62340632, 328.51303903, 341.97344285], [ 205.02121677, 235.71812371, 32.91252756]]])
and maximum radius
R = 35
I would like to output a 2D array with the same height and width, with labels that represent the sphere of each point in the three-dimensional array. At two points with the same label, the Euclidean distance must be greater than the maximum radius, no sphere should be empty, and the algorithm should use the minimum number of spheres available for this.