Finds the Best Matching Unit @param numericalValues the vector to find hte BMU of @return the BMU of the given vector
(Vec numericalValues)
| 318 | * @return the BMU of the given vector |
| 319 | */ |
| 320 | private PairedReturn<Integer, Integer> getBMU(Vec numericalValues) |
| 321 | { |
| 322 | double bestDist = Double.MAX_VALUE; |
| 323 | int x = -1, y = -1; |
| 324 | for(int i = 0; i < weights.length; i++) |
| 325 | { |
| 326 | Vec[] weights_i = weights[i]; |
| 327 | for(int j = 0; j < weights[i].length; j++) |
| 328 | { |
| 329 | double dist = dm.dist(weights_i[j], numericalValues); |
| 330 | if(dist < bestDist) |
| 331 | { |
| 332 | bestDist =dist; |
| 333 | x = i; |
| 334 | y = j; |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | return new PairedReturn<Integer, Integer>(x, y); |
| 340 | } |
| 341 | |
| 342 | @Override |
| 343 | public List<Parameter> getParameters() |