How to find out cluster center mean of DBSCAN in R?

0 votes

By using dbscan in package fpc I am able to get an output of the following:

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

 I need to find the cluster center (mean of the cluster with most seeds). 

Can anyone show me how to proceed with this?

Thank you.

Jun 27, 2018 in Data Analytics by CodingByHeart77
• 3,680 points
82 views

1 answer to this question.

0 votes

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
answered Jun 27, 2018 by darklord
• 6,140 points

Related Questions In Data Analytics

0 votes
1 answer

How to find out the sum/mean for multiple variables per group in R?

You can use the reshape2 package for ...READ MORE

answered Apr 12, 2018 in Data Analytics by DataKing99
• 8,100 points
254 views
0 votes
1 answer

How to find out the package version which is loaded in R?

You can use sessionInfo() to accomplish that. > ...READ MORE

answered Apr 18, 2018 in Data Analytics by zombie
• 3,690 points
22 views
0 votes
1 answer

How to write a custom function which will replace all the missing values in a vector with the mean of values in R?

Consider this vector: a<-c(1,2,3,NA,4,5,NA,NA) Write the function to impute ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,680 points
93 views
0 votes
1 answer

How to find out which version of R is loaded

You can use sessionInfo() to accomplish that. > sessionInfo() R version ...READ MORE

answered Nov 8, 2018 in Data Analytics by Maverick
• 10,040 points
16 views
0 votes
1 answer

Is there any easy way to fill in missing data?

You can try the following code: First, you ...READ MORE

answered Jun 20, 2018 in Data Analytics by DataKing99
• 8,100 points
32 views
0 votes
1 answer

How to cluster center mean of DBSCAN in R?

Just index back into the original data ...READ MORE

answered Jun 25, 2018 in Data Analytics by DataKing99
• 8,100 points
42 views
0 votes
1 answer

SMOTE-function not working in R

If you convert 'y' to a factor, ...READ MORE

answered Jun 26, 2018 in Data Analytics by CodingByHeart77
• 3,680 points
320 views
0 votes
1 answer

Create vector matrix of movie ratings using R project?

Why do'nt you try the dcast function, in the reshape2 package. d ...READ MORE

answered Jun 29, 2018 in Data Analytics by anonymous
53 views
0 votes
1 answer

How to convert a list of dataframes in to a single dataframe using R?

You can use the plyr function: data <- ...READ MORE

answered Apr 13, 2018 in Data Analytics by darklord
• 6,140 points
89 views
0 votes
1 answer

How to cluster a very large dataset in R?

You can initially use kmeans, to calculate ...READ MORE

answered Jun 19, 2018 in Data Analytics by darklord
• 6,140 points
64 views