predict.som: Predictions from a som Object

Description Usage Arguments Value Author(s) See Also Examples

Description

Predictions are obtained from the minimum distance between a prototype and a row of the data.

Usage

1
predict.som(object, newdata, type = "class")

Arguments

object

a som object

newdata

a data frame in which to interpret the variables of the som object.

type

Output type (character), [ 'class' | 'meta' | 'dist'].

Value

type = 'class' gives the class id for each row. type = 'meta' gives the meta-class id for each row. type = 'dist' gives the entire distances matrix.

Author(s)

David Gohel

See Also

som learn update.som summary.som plot.som

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(MASS)
lcrabs <- log(crabs[, 4:8])

lcrabs.som <- som ( formula = ~ . , data = lcrabs
	, neighborhood = "uniform"
	, grid = grid ( xdim = 10 , ydim = 10 , type = "hexagonal" ) 
	, weights.min = min (lcrabs), weights.max = max (lcrabs)
	)
lcrabs.som <- learn( lcrabs.som , number.iter = 500 , max.alpha = 0.5, min.alpha = .001, max.rayon = 3 , step.eval.si = 50)

predict( lcrabs.som)
predict( lcrabs.som , type = "dist" )

harrysouthworth/kohonen documentation built on May 17, 2019, 3:03 p.m.