Learn R Programming

popsom (version 5.2)

predict: Compute Classification Labels for Given Points

Description

Compute classification labels for points in a given data frame using the underlying clustering model. If the training data is unlabeled then generated labels are used.

Usage

predict(map,points)

Arguments

map

An object of type 'map'.

points

A data frame of points to be classified.

Value

A data frame with classification results. The data frame has two columns:

Label

The assigned label to the observation at the same row in the 'points' data frame.

Confidence

A confidence value assigned to the label prediction.

Examples

Run this code
# NOT RUN {
data(iris)

df <- subset(iris,select=-Species)
labels <- subset(iris,select=Species)

m <- map(df,labels,xdim=15,ydim=10,train=10000)

predict(m,df)
# }

Run the code above in your browser using DataLab