Description Usage Arguments Details Value Note Author(s) References See Also Examples
Compute the distances between the prototypes of a fitted Self-Organising Map (SOM) for neighbouring units in the prior structure.
1 2 3 4 5 |
som |
an object of class |
check |
logical, with default to |
x |
an object of class |
extended |
logical. If |
... |
not used |
FUN |
not used |
The as.matrix
method can be used to convert a distance matrix
(an object of class"sompdist"
) into a classical distance matrix
as obtained via the as.matrix
applied to objects of class
"dist"
(see dist
). However, the distance
matrix obtained this way is not the matrix of the Euclidean
distances between the prototypes of the SOM: only
the distances between direct neighbours in the grid are
considered (see as.dist.somnum
,
as.dist.relationalsom
and
as.dist.kernelsom
for all pairwise
distances between prototypes). There are used as edge lengths (or
weights) for an
undirected graph whose nodes are the units and which has edges only
between direct neighbours. If the as.matrix
method is called
with extended=TRUE
(the default value), then this graph is used
to define a distance between any pair of nodes in the grid as the
length of the shortest path between the considered node (this is the
unit distance used in error.kaskilagus
). If the
method is used with extended=FALSE
, then the missing distances
(i.e. between non direct neighbours) are unknown (value NA
).
If the som
is a relational SOM, the "distances" between
prototypes are computed via the relational extension which can lead
under some circumstances to negative values. If the check
parameter is set to TRUE
, the code will stop in this
circumstance. This should never happen in the case of the kernel
SOM. However, no effort is made to verify that the kernel matrix is
non negative and therefore, negative values can also be found in this
case. As in the relational case, a TRUE
value for check
asks to the code to stop in case of negative values.
The as.dist
method can be used to convert a distance matrix
(an object of class "sompdist"
) into an object of class
"dist"
. The extension procedure described above is always
used.
Visualisation of the obtained distance matrix can be done directly
with the plot.sompdist
method or indirectly via the
distance.grid
function.
prototype.distances
returns an object of
class"sompdist"
, a list with components:
pdist |
a matrix containing the distances between prototypes. It
has one row for each prototype and 6 or 8 columns,
depending on the topology of the prior structure (6 for a hexagonal
grid and 8 for a rectangular one). When a prototype has not the
maximum number of neighbours because of its position in the grid,
the corresponding entries are encoded with |
somgrid |
an object of class |
as.matrix
returns a square matrix and as.dist
an object
of class "dist"
.
This function applies to standard numerical Self-Organising Map but also to relational SOM. In the first case, the distances between prototypes is the standard Euclidean distance. In the second case, the distance is obtained via the relational formula which can lead to negative values. When such values are obtained, they are replaced by zeros and a warning is generated.
Fabrice Rossi
Kaski, S. and Lagus, K. (1996) Comparing self-organizing maps, in: C. von der Malsburg, W. von Seelen, J. Vorbrüggen, B. Sendhoff (eds.), Proceedings of International Conference on Artificial Neural Networks (ICANN'96, Bochum, Germany), vol. 1112 of Lecture Notes in Computer Science, Springer, pp. 809–814.
See distance.grid
for converting the prototypes
distances into a grid of values that can be easily displayed,
plot.sompdist
and umatrix
for simple
visualisations of those distances and
error.kaskilagus
for an error measure based on
prototypes distances. See as.dist.somnum
for all pairwise
distances between prototypes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.