somgrid | Generate a data according to the grid of a TS-SOM |
-s <som> | name of a TS-SOM |
-min <mindef> | definition for minimum values |
-max <maxdef> | definition for maximum values |
-sca <func> | scaling function |
[-dim <dim>] | index of the SOM's dimension (default 0) |
[-d <src-data>] | source data for naming |
[-dout <data-out>] | output data |
[-fout <field-out>] | output field |
This operation generates new data points according to the grid of a TS-SOM. It creates a data point for each neuron of the given TS-SOM <som>.
The basic idea is to generate values according to the indexes of the neurons. Actually, only one index can run, and it is defined with dimension <dim>. Thus, new values will be constant related to other dimensions. When values are generated, they are scaled into the given range [<mindef>,<maxdef>].
The scaling function <func> defines, how new values are generated. Also, parameters <mindef> and <maxdef> depend on the function as follows:
There are three alternatives, how to name the new data fields. If only one data field is created, then its name can be defined with parameter <field-out>. If parameter <src-data> has been given, then new data fields are named according to fields in this data frame. If both of these parameters have been omitted, new fields are named automatically as f0, f1,
The data points can be stored in two alternative ways. If the output data frame <data-out> has been specified, then the generated data points are stored there. Otherwise new data fields are added into the current directory.
Example (ex5.17): In this example, the MLP network is trained with Boston data (zn, indus rate). Then, an empty TS-SOM is created for the basis of visualization. Two variables (zn and indus) are used for dimensions x and y by issuing command somgrid, and the trained network is used to predict the value of variable rate for each node of the grid.
... # Train MLP network by the rprop NDA> select src -f boston.zn boston.indus NDA> prepro -d src -dout src2 -e NDA> select trg -f boston.rate NDA> prepro -d trg -dout trg2 -e NDA> rprop -d src2 -dout trg2 -net 2 6 1 -full -types t t -em 300 -bs 0.01 -mup 1.1 -mdm 0.8 -wout wei -ef virhe # Build TS-SOM and generate values based on statistics NDA> somtr build -sout s1 -l 6 -D 2 ... NDA> select x -f src2.zn NDA> select y -f src2.indus NDA> fldstat -d x -dout xsta -min -max NDA> fldstat -d y -dout ysta -min -max NDA> somgrid -s s1 -min xsta.min -max xsta.max -d x -dout datain -sca vec -dim 0 NDA> somgrid -s s1 -min ysta.min -max ysta.max -d y -dout datain -sca vec -dim 1 # Predict "rate" NDA> fbp -d datain -win wei -dout trgout # Create graphics and show it NDA> mkgrp /win1 -s /s1 NDA> show win1