SOM Extension - Using Existing Maps

Introduction

When a Self-Organized Map has been created, it is usually shown using several visualizations with different meanings. One may want at first to see the overview of the data mapping. Then he studies how the values of variables change when traveling on the map to different directions in order to know what the locations on a map mean - for example, where are the top performers. Then he may want to examine what are the differences e.g. in the resources between the top-performers and the weakest ones. When comparing the new data to last years situation it might be useful to load the map analyzed a year ago and map the new numbers onto it. All this means, that the SOM must be stored into current session storage for different visualization needs, and into media for later use.

The typical use cases and the techniques needed to store SOMs are discussed in this page.

Creating Several Visualizations on the Same Page

SOM tag behaves like any Chart data source. When it is defined in JSP code inside and <chart:def> tag, it is saved into the request scope, and can be accessed later within the same request using the <chart:out> tag.

A typical use case is when showing the colorized Sammon's mapping of the SOM as an overview and all the variables as component planes for describing the map areas.

An overview of a SOM and its component planes.

Labeling SOM with New Data

It is often wanted to label the SOM with the same data rows so that the label is taken from another column, or new data is mapped onto an existing map.

When the new labeling (or other action) is made inside a request where exists a SOM, then the existing can be refferred by the <som> tag's 'source' attribute. Note that if no special tags are given inside the <som> tag, then it will be initialized, trained, and labeled using the given datasource.
Also note that if the data was normalized, the new data must be normalized in a similar way in order to get reasonable results. This is made by referring to the existing SOM (which contains the normalization information) using the 'weightsFrom' attribute.

In the example below Germany and Ireland are added to the existing SOM.

Labeled and Relabeled SOMs.

Showing the SOM in Separate Windows

It is sometimes useful to see different viewpoints of the same SOM. A typical case is the viewing of the reference vector of one cell or some cells. In this case the natural interface for accessing the cell contents is the main map - when clicking the cells on it, their reference vectors will appear in a bar graph in another window.

That can be made in JSP code, when using Chart-taglib in by

  1. defining a proper annotation for the main map,
  2. storing the SOM into session context when it was created,
  3. fetching the SOM from session context in the another JSP page, and
  4. using a special somCellFilter datasource to pick the selected cells from the SOM.
To learn more about annotating SOM images, see "Drill-down" sub-chapter below. Storing the SOM into a session and fetching from it can be made using the <chart:exportData> and <chart:importData> tags nested in <chart:def> tag. <somCellFilter> is just a datasource, which picks the data for defined cells from the SOM data. That data can be visualized using the traditional graphs.
A SOM and a bar graph of the reference vectors of some of its cells.

Saving and Loading SOM

A SOM map can be stored as an XML file by using the <chart:exportData> tag. Just give scope="FILE" and give the filename as id. The file is saved into the same folder where the executed code lies, expect if the filename starts with a separator char (e.g. backslash in Windows), when the file is stored into webapp's root. Missing folders are not created.

A saved SOM can be retrieved later by giving its URL into the <som> tag's 'source' attribute.

The example code below first creates a SOM and exports it to file. Then it reads and shows it.

A SOM retrieved from an XML file.

Drill-down

The drill-down feature works in SOM in a similar way like with other charts by giving an annotation with 'href' attribute. The 'href' attribute may contain macros. The most important "additional" channel labels available in SOM data are

It's usually required to URL-encode the paint values. This can be made with the "URL:" prefix, like <annotation href="changeBgColor.jsp?p={URL:.paint}" />