map.gsom: Map data to a supervised or unsupervised gsom object

Description Usage Arguments Value Author(s) See Also Examples

View source: R/map.gsom.r

Description

Map a data matrix onto a trained gsom object.

Usage

1
2
  ## S3 method for class 'gsom'
  map.gsom(gsom_object, df, retaindata = FALSE, ...)

Arguments

gsom_object

a trained gsom map (either unsupervised, as obtained by train.gsom, or supervised, as returned by train_xy.gsom).

df

Data matrix, with rows corresponding to objects, and columns to the dimensions the gsom object was trained with

retaindata

if set to TRUE a copy of the mapped data (unscaled) will be added to the returned object.

...

not used.

Value

Returns a S3 object of type "gsom" containing:

nodes$position

the location of the nodes on the map.

nodes$codes

codes that were established during the training for each node and dimension of the data.

nodes$freq

how many times each node was the best matching node for the mapped matrix.

mapped$bmn

contains the best matching node for each of the data that was mapped.

mapped$dist

distance from best matching node for each row of the mapped data-matrix.

data

Unscaled copy of the data that was mapped.

Author(s)

Alex Hunziker

See Also

train.gsom, predict.gsom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  #Get some data
  data(iris)
  s = sample(1:150, 100)
  train_set = iris[s,1:4]
  test_set = iris[-s,1:4]

  # Create a GSOM Model
  gsom_iris <- train.gsom(train_set, spreadfactor=0.75)

  # Mapping
  mapped_iris <- map.gsom(gsom_iris, test_set)

GrowingSOM documentation built on May 30, 2017, 6:24 a.m.