Learn R Programming

matchFeat (version 1.0)

predict.matchFeat: Match New Feature Vectors To Existing Clusters

Description

predict method for class "matchFeat"

Usage

# S3 method for matchFeat
predict(object, newdata, unit = NULL, ...)

Value

A list of class matchFeat with fields

sigma

best matching as set of permutations (\((m,n)\) matrix)

cluster

best matching as cluster indicators (\((m,n)\)-matrix)

objective

minimum objective value

mu

mean vector for each class/label (\((p,m)\) matrix)

V

covariance matrix for each class/label (\((p,p,m)\) array if equal.variance is FALSE, \((p,p)\) matrix otherwise

call

function call

Arguments

object

an object of class "matchFeat".

newdata

new dataset of feature vectors

unit

unit labels for new data. Only necessary if newdata is a matrix

...

for compatibility with the generic predict method; argument not currently used.

Details

The function predict.matchFeat finds the best matching for new feature vectors relative to an existing set of cluster/class centers. If codeobject results from a call to match.gaussmix, the same function is used for prediction (with fixed mean vectors and covariance matrices). In other cases, the function match.template is used for prediction.

See Also

print.matchFeat, summary.matchFeat

Examples

Run this code
data(optdigits)
train.result <- match.bca(optdigits$x[1:900,], optdigits$unit[1:900])  
test.result <- predict(train.result, optdigits$x[901:1000,], optdigits$unit[901:1000])
test.result

Run the code above in your browser using DataLab