R中DBSCAN的群集中心均值? [英] Cluster center mean of DBSCAN in R?

查看:66
本文介绍了R中DBSCAN的群集中心均值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用软件包 fpc 中的 dbscan 我可以得到以下输出:

Using dbscan in package fpc I am able to get an output of:

dbscan Pts=322 MinPts=20 eps=0.005
        0   1
seed    0 233
border 87   2
total  87 235

但是我需要找到聚类中心(具有多数种子的聚类的平均值)。谁能告诉我如何进行此操作?

but I need to find the cluster center (mean of cluster with most seeds). Can anyone show me how to proceed with this?

推荐答案

只需使用您选择的集群ID索引回原始数据即可。然后,您可以轻松地对子集进行任何所需的进一步处理。这是一个示例:

Just index back into the original data using the cluster ID of your choice. Then you can easily do whatever further processing you want to the subset. Here is an example:

library(fpc)

n = 100
set.seed(12345)
data = matrix(rnorm(n*3), nrow=n)
data.ds = dbscan(data, 0.5)



> data.ds
dbscan Pts=100 MinPts=5 eps=0.5
        0 1 2 3
seed    0 1 3 1
border 83 4 4 4
total  83 5 7 5
> colMeans(data[data.ds$cluster==0, ])
[1]  0.28521404 -0.02804152 -0.06836167

这篇关于R中DBSCAN的群集中心均值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆