predict.somRes: Predict the classification of a new observation

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/prediction.R

Description

Predict the neuron where a new observation is classified

Usage

1
2
## S3 method for class 'somRes'
predict(object, x.new = NULL, ..., radius = 0)

Arguments

object

a somRes object.

x.new

a new observation (optional). Default values is NULL which corresponds to performing prediction on the training dataset.

...

not used.

radius

current radius used to perform soft affectation (when affectation = "heskes", see initSOM for further details about Heskes' soft affectation). Default value is 0, which corresponds to a hard affectation.

Details

The number of columns of the new observations (or its length if only one observation is provided) must match the number of columns of the data set given to the SOM algorithm (see trainSOM).

Value

predict.somRes returns the number of the neuron to which the new observation is assigned (i.e., neuron with the closest prototype).

When the algorithm's type is "korresp", x.new must be the original contingency table passed to the algorithm.

Author(s)

Jérome Mariette jerome.mariette@inrae.fr
Madalina Olteanu olteanu@ceremade.dauphine.fr
Fabrice Rossi fabrice.rossi@apiacoa.org
Nathalie Vialaneix nathalie.vialaneix@inrae.fr

See Also

trainSOM

Examples

1
2
3
set.seed(2343)
my.som <- trainSOM(x.data = iris[-100, 1:4], dimension = c(5, 5))
predict(my.som, iris[100, 1:4])

SOMbrero documentation built on Jan. 4, 2022, 1:07 a.m.