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

Description Usage Arguments Value Author(s) See Also Examples

View source: R/map.hdgsom.r

Description

Map a data matrix onto a trained hdgsom object.

Usage

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

Arguments

hdgsom_object

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

df

Data matrix, with rows corresponding to objects, and columns to the dimensions the hdgsom 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 "hdgsom" 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 Alejandro Blanco Martinez

See Also

train.hdgsom, predict.hdgsom

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
  hdgsom_iris <- train.hdgsom(train_set, spreadfactor=0.75)

  # Mapping
  mapped_iris <- map.hdgsom(hdgsom_iris, test_set)

alecuba16/HDGSOM documentation built on April 11, 2020, 5:06 a.m.