[R] custom metric for dist for use with hclust/kmeans

Vivek Ayer vivek.ayer at gmail.com
Thu May 6 17:56:14 CEST 2010


Bump...no insights on defining custom metrics. Guess I'll give the
other languages a shot.

Vivek

On Wed, May 5, 2010 at 10:13 AM, Vivek Ayer <vivek.ayer at gmail.com> wrote:
> Hi guys,
>
> I've been using the kmeans and hclust functions for some time now and
> was wondering if I could specify a custom metric when passing my data
> frame into hclust as a distance matrix. Actually, kmeans doesn't even
> take a distance matrix; it takes the data frame directly. I was
> wondering if there's a way or if there's a package that lets you
> create distance matrices from non-standard metrics, e.g.,
> KL-divergence (which is not really one), but metrics used often in
> information theory. I'm assuming kmeans just assumes the euclidean
> metric, but it would be nice to customize that as well. Is stuff out
> there, or would I have create my own?
>
> Thanks,
> Vivek
>



More information about the R-help mailing list