Cylindrical Clustering in R - clustering timestamp with other data

后端 未结 2 1166
悲哀的现实
悲哀的现实 2021-01-14 17:09

I\'m learning R and I have to cluster numeric data with a timestamp field. One of the parameters is a time, and since the data is strictly day-night dependent, I want to ta

2条回答
  •  时光说笑
    2021-01-14 17:32

    k-means should use squared Euclidean distance.

    But indeed: projecting your data into a meaningful Euclidean space is an easy way to avoid this kind of problems.

    However be aware that your mean will no longer lie on the cylinder. In many cases, you can just scale the mean to the desired cylinder. But it might become 0, then no meaningful rescaling is possible.

    The other option is kernel k-means. As your desired distance is Euclidean after a data transformation, you can also "kernelize" this transformation, and use kernel k-means. But it may actually be faster to transform your data in your particular case. It will likely only pay off when using much more complex transformations (say, to an infinite dimensional vector space).

提交回复
热议问题