⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 som_grid.html

📁 Kohonen的SOM软件包
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><html><head><title>SOM Toolbox / som_grid </title></head><body bgcolor=#f0f0f0><table border=0 width="100%" cellpadding=0 cellspacing=0><tr><td valign=baseline><font size=+2>SOM Toolbox</font></td><td valign=baseline align=center><a href="somtoolbox.html">Online documentation</td><td valign=baseline align=right><a href="http://www.cis.hut.fi/projects/somtoolbox/" target="_top">http://www.cis.hut.fi/projects/somtoolbox/</a></td></tr></table><hr><H1> som_grid </H1><H3> Purpose </H3><PRE>  To visualize the SOM grid in various ways </PRE><H3> Syntax </H3><UL><PRE>  [sGrid,m,l,t,s]=som_grid(sGrid)  [sGrid,m,l,t,s]=som_grid(sTopol)  [sGrid,m,l,t,s]=som_grid(sMap)  [sGrid,m,l,t,s]=som_grid({lattice, msize, [shape]})   [sGrid,m,l,t,s]=som_grid(lattice, msize)  [sGrid,m,l,t,s]=som_grid(..., ['argID', value, ...])</PRE></UL><H3> Description </H3><PRE> The SOM can be defined as a set of units (neurons) and their topological relations.  This function is used to visualize these in various ways. The units may be drawn using different markers and colors, in different sizes and in different locations in 2D or 3D. However the topological neighborhood is limited to be 2-dimensional. The connections between these units may be drawn using lines having different thicknesses and colors. Labeling text may be plotted on the units. It is possible also to draw a surface between the units. The surface coloring is either indexed (one value per unit) or fixed RGB (a 1x3 RGB triple per unit).</PRE><H3> Required input arguments </H3><PRE> Note: M is the number of map units. The first (or first two) argument may have various different types of values   1. sGrid   (struct) som_grid struct (the output of this function)     The struct initiates the visualization. The argID-value -pairs     are used to alter the initiation.   Following argument types may be used to give the topology for the grid   2. sTopol  (struct) som_topol struct    3. sMap    (struct) som_map struct (only topology matters)   4. {lattice, msize} or {lattice, msize, sheet} (cell array)        - lattice must be 'hexa' or 'rect'       - msize must be a 1x2 vector       - shape (if specified) must be string 'sheet', 'cyl' or 'toroid'         If shape is not given it is 'sheet' by default.   5. lattice (string or matrix) AND msize (1x2 vector) as two separate arguments       - lattice may be string 'rect' or 'hexa' or a connection matrix         (see SOM_CONNECTION) to define a free topology. This connection         matrix is of size MxM and its element i,j (i<j) is set         to 1 if there is a connection between units i and j, otherwise to          zero. Shape is set to 'sheet' by default. Shape does not have any          meaning if a free topology is specified, anyway.       - msize must be a 1x2 vector  In cases 2...5 the sGrid structure is initiated by default values  which are set in SOM_SET. These include black markers 'o' (6pt),  light gray conncection lines (graph edges), unit coordinates  according to the lattice ('hexa','rect'), no labels, and no  surface.</PRE><H3> Optional input arguments </H3><PRE>  Note: M is the number of map units.  Here is a list of the valid arguments IDs and the associated  values (identifiers are case insensitive):  'Coord'     Unit coordinates              This defines the coordinates of the units. Default: the              topological coordinates (calculated as in function              SOM_VIS_COORDS and SOM_CPLANE). If the topology is free              (lattice is a connection matrix) this argument is obligatory!     (matrix) size Mx2 of 2D coordinates for each unit     (matrix) size Mx3 of 3D coordinates for each unit 'Marker'       Unit markers, default is 'o'.     (string) 'o','+','x','*','v','^','<','>','h','s','d', 'p','.', or 'none'              give the same marker for each unit.      (cell array) of size Mx1 of previous strings gives individual               markers for each unit. 'MarkerSize'   Size (pt) of unit markers, default is 6 (pt).     (scalar) gives the same size for every unit.       (matrix) Mx1 gives an individual size for each unit marker.    'MarkerColor' Unit marker colors, default is 'k'     (ColorSpec) gives the same color each unit.      (matrix) Mx3 of RGB triples gives individual color for each unit              Note that indexed coloring - like in SOM_CPLANE - is              not possible. If indexed coloring is needed, you can              use SOM_NORMCOLOR to calculate RGB colors that              emulate indexed coloring. However, the colors for the              units are fixed, so changing colormap will not              change the colors.  'Line'        Line type, default is '-'.     (string) '-',':','--' or '-.' or 'none'. Only one linetype in              grid is allowed.    'LineWidth'   Width of the topological connection lines (edges)       (scalar) gives the same width for each line. Default is 0.5.     (matrix) MxM sparse (or full) matrix gives individual width for               each connection. The element (i,j), i<j, gives the line width for               connection between nodes i and j. (The sparse form is              recommended for saving memory, a full matrix works as well,              of course). Note that only the elements satisfying i<j              matter - as the elememts for which j >= i are ignored in              order to avoid ambiguous situations if the matrix would be               non-symmetric. The "connections to oneself" is not drawn.               Line width zero is valid and causes the line to disappear.  'LineColor'   Color of connection lines, default is [0.9 0.9 0.9].     (ColorSpec) gives the same color for each line     (matrix) MxMx3 matrix of RGB triples gives individual width for               each connection. The element (i,j,:), i<j, gives the RGB triple for               line between nodes i and j.          (cell array) of three sparse (or full) matrices {r,g,b} where               r(i,j), g(i,j) and b(i,j) gives the R,G, and B values in the RGB              triple for the line between nodes i and j. (The motivation for this              form is the fact that a 3D arrays can't use sparse format in               Matlab version 5.1.)              Note that only the elements satisfying i<j matter - the elememts               for which j >= i are ignored in order to avoid ambiguous situations               if the matrix was non-symmetric. The "connections to oneself"              is not drawn.   'Label'       Labels for units, default is [].     (empty)  [] means no labels.     (char array) of size Mx1. Element (i,:) has the label for unit i.          (cell array) of size MxL consisting of sets of labels. Element {i,:}               contains the labeling for unit i.                In case of multiple labels, the labels for one unit are shown                in one column centered at that unit.   'LabelSize'   Text size of labels (points), default is 10.     (scalar) Default is 10.   'LabelColor'  Color of labels, default is 'c' (cyan).     (ColorSpec) gives the same color for each label string 'xor'                 sets the colors automatically so that they differ                 from the background (using Matlab's built-in xor-color feature.)  'Surf'         Surface between nodes, default is [].     (empty)  [] gives no surface     (vector) Mx1 gives an indexed interpolated color surface between               units using the actual colormap.     (matrix) Mx3 matrix of RGB triples gives a interpolated color surface               between units using fixed RGB colors.              Note that the interpolation is done using Matlab's built-in              color interpolation for SURF objects.</PRE><H3> Output arguments </H3><PRE>  sGrid    (struct) with fields S.msize, S.shape, S.lattice, S.coord, S.marker,                     S.markersize, S.markercolor, S.line, S.linewidth, S.linecolor,                    S.surf, S.label, S.labelsize, S.labelcolor  m        (matrix) handels to LINE objects (unit markers)   l        (matrix) handles to LINE objects (lines connecting the units)  t        (matrix) handles to TEXT objects (labels)  s        (scalar) handle  to SURF object  (surface between units)</PRE><H3> Examples </H3><PRE> % Make map of size 15x10 on random data:    map=som_make(rand(1000,4),'msize',[15 10], 'lattice', 'hexa'); % Draw the grid using two frist varable values as coordinates % and store the sGrid struct in varable S:    S=som_grid(map, 'coord', map.codebook(:,[1 2])) %Define some things:  % % Create a cell array of size 150x1 that divides map in to two label classes % 'circles' and 'squares'    L(1:75,1)='o'; L(76:150,1)='s'; L = cellstr(L); % Create a coloring according to the 3rd variable according to current % colormap:     C = som_normcolor(map.codebook(:,3)); % Change the visualization: use black lines, unit markers in M and unit % color in C, and set unit size to 10:    S=som_grid(S, 'linecolor', 'k', 'marker', L, 'MarkerColor',C, ...     'MarkerSize', 10); % Do a new visualization, use indexed color surface calcualted from the % first variable, coordinates according to the lattice (default) but  % no markers nor lines:    S=som_grid(map,'line','none','marker','none','surf',map.codebook(:,1)); % Set coordinates according to three last varables    som_grid(S,'coord',map.codebook(:,2:4)); % Create a random connection matrix R1 and the usual hexagonal % neighborhood connection matrix R2:     R1=sparse(rand(150,150)>0.9);     R2=som_connection(map); % Show these connections. Note that coordinates _must_ now be given % explicitly: we form default topological coordinates using % som_unit_coords.    som_grid(R1,map.topol.msize,'coord',som_unit_coords(map));    som_grid(R2,map.topol.msize,'coord',som_unit_coords(map)); % Show connections (R1 AND R2)    som_grid(R2.*R2,map.topol.msize,'coord',som_unit_coords(map));</PRE><H3> Object tags </H3><PRE>  No tags are set.</PRE><H3> See also </H3><TABLE NOBORDER WIDTH=80%><TR><TD><a href="som_show.html"><B>som_show</B></a><TD> The basic map visualization routine<TR><TD><a href="som_cplane.html"><B>som_cplane</B></a><TD> The basic component plane visualization<TR><TD><a href="som_connection.html"><B>som_connection</B></a><TD> The basic topological connections<TR><TD><a href="scatter.html"><B>scatter</B></a><TD> Scatter plots<TR><TD><a href="scatter3.html"><B>scatter3</B></a><TD> 3-dimensional scatter plots</TABLE><p><hr><br><br><!-- Last updated: May 30 2002 --></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -