[R] Assign new observations to Clara clusters

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jul 26 18:11:48 CEST 2005


On Tue, 26 Jul 2005, Nestor Fernandez wrote:

> Dear all,
>
> I need to assign new observations to cluster groups previously identified for a
> different dataset. The original clustering was performed using Clara. I gess
> one way is to assign each new observation to the nearest medioid of the
> original cluster. Is there a way of doing this in R? Is there a better way of
> classifying new observations into clusters?

If you have the medoids (and these are in the fit object), use knn1 (in 
package class) to assign.

Cluster analysis is not really designed to classify new observations. 
With Euclidean distance the above is possible, but I would probably take 
the clusters formed and used them to do a supervised classification: your 
default option is edited NN-1 classification and you may well be able to 
do better, depending on the size of the problem.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list