Learn R Programming

fdm2id (version 0.9.6)

predict.em: Predict function for EM

Description

Return the closest EM cluster for a new dataset.

Usage

# S3 method for em
predict(object, newdata, ...)

Arguments

object

The classification model (of class em-class, created by EM).

newdata

A new dataset (a data.frame), with same variables as the learning dataset.

...

Other parameters.

See Also

EM

Examples

Run this code
require (datasets)
data (iris)
d = splitdata (iris, 5)
model = EM (d$train.x, 3)
predict (model, d$test.x)

Run the code above in your browser using DataLab