Description Usage Arguments Value Author(s) See Also Examples
Map a data matrix onto a trained hdgsom object.
1 2 | ## S3 method for class 'hdgsom'
map.hdgsom(hdgsom_object, df, retaindata = FALSE, ...)
|
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. |
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. |
Alex Hunziker Alejandro Blanco Martinez
train.hdgsom, predict.hdgsom
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.