| predict.matchFeat {matchFeat} | R Documentation |
Match New Feature Vectors To Existing Clusters
Description
predict method for class "matchFeat"
Usage
## S3 method for class 'matchFeat'
predict(object, newdata, unit = NULL, ...)
Arguments
object |
an object of class |
newdata |
new dataset of feature vectors |
unit |
unit labels for new data. Only necessary if |
... |
for compatibility with the generic |
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.
Value
A list of class matchFeat with fields
sigmabest matching as set of permutations (
(m,n)matrix)clusterbest matching as cluster indicators (
(m,n)-matrix)objectiveminimum objective value
mumean vector for each class/label (
(p,m)matrix)Vcovariance matrix for each class/label (
(p,p,m)array ifequal.varianceis FALSE,(p,p)matrix otherwisecallfunction call
See Also
print.matchFeat, summary.matchFeat
Examples
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