Domanda

I have read about the U-Matrix in many places including this site. The best explanation of a U-Matrix is found here in this site with the explanation why there is so little correct information (the original paper is not at all useful) about how the U-Matrix is properly calculated.

The answer to the above question completely explains the concept for a hexagonal map. But the logic of calculating the U-matrix in the answer to the linked question do not hold when the map is rectangular.

For example consider 3 x 3 rectangular lattice as shown below.

The Rectangular Map

Using the above lattice I can calculate the U-Matrix as shown below.

The U-Matrix

The yellow colored squares are the distances between the blue colored squares. I'm certain about the yellow colored squares. I'm also certain about the blue colored squares since we only need to take the average or the median of its surrounding.

So my question is : How to calculate the red squares?

I found a few sources including the ones mentioned in the previous question I have cited above. The best explanations I got for a rectangular U-Matrix is the following

Description 1 -> In this paper the authors does not completely explain how to calculate the red squares. Just explains the average of the surrounding needs to be taken. Which is not clear and in my opinion not proper (see below)

Description 2 -> In this paper the authors have clearly stated how to calculate the red squares but the logic they have presented seem flawed.

My explanation why the above might not be proper

If one takes the average of its surrounding to calculate the red squares as mentioned by description 1 the calculation of blue squares would be directly affected. For example consider calculating the value of blue square number 1 in U-Matrix. If we are to take the average of its surrounding we need distances (1,2) , (1,4) and (1,5). If we fill the corresponding red square with (1,5) the calculation for the blue square 4 is wrong since we did not calculate (2,4) and the same red square should be the place to have it. So the equation of dividing the addition of (1,5) and (2,4) by 2*(1.414...) will not work since there is a component which does not belong to the average. In the case of blue square 1 the distance portion of (2,4) do not belong there.

I programmed using the description in the second paper and the U-Matrix generated for a simple data set is not satisfactory. Whilst the average of distances around a given node performs better than the U-Matrix for the same data set as given below. (The images are U-Matrix followed by the average)

U-Matrix enter image description here

È stato utile?

Soluzione

I didn't read the papers you mentioned and I have been working mostly with hexagonal maps, but it seems the most reasonable solution is to caclulate the red squares as averages of the yellow squares since these are their neighbors. When you use rectangular maps there are no diagonal connections since if they were then it would be more like a hexagonal map. So yellow squares are the ones you shound take into account. Think of the red squares as "fake" map units that fill in the gaps created by the interpolation of the nodes made in the U matrix. By the way, hexagonal maps are considered better in capturing the topology of the underling dataset.

Altri suggerimenti

I really appreciate the question. I agree with the answer that thinking the red squares as "fake" map units and hence assigning the average values of yellow squares is a good solution. Further and simpler, we create a distance map with the identical size of the training grid and then we assign the average values of a square's neighbours to the square. I found this is the solution adopted by the minisom. See the following get_distance() function __doc__ for convenience.

    def distance_map(self):
        """Returns the distance map of the weights.
        Each cell is the normalised sum of the distances between
        a neuron and its neighbours."""
        um = zeros((self._weights.shape[0], self._weights.shape[1]))
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top