similar to: clustering question ... hclust & kmeans

Displaying 20 results from an estimated 10000 matches similar to: "clustering question ... hclust & kmeans"

2005 Mar 31
2
Using kmeans given cluster centroids and data with NAs
Hello, I have used the functions agnes and cutree to cluster my data (4977 objects x 22 variables) into 8 clusters. I would like to refine the solution using a k-means or similar algorithm, setting the initial cluster centres as the group means from agnes. However my data matrix has NA's in it and the function kmeans does not appear to accept this? > dim(centres) [1] 8 22 > dim(data)
2001 Mar 13
1
kmeans cluster stability
I'm doing kmeans partitioning on a small (n=26) dataset that has 5 variables. I noticed that if I repeatedly run the same command, the cluster centers change and the cluster membership changes. Using RW1022 under Windows NT & Windows 2000 >kmeans(pottery[,1:5], 4, 20) [...snip] $size [1] 7 3 9 7 [...snip] $size [1] 7 10 4 5 [...snip] $size [1] 6 10 5 5 yields a different
2006 Mar 29
6
which function to use to do classification
Dear All, I have a data, suppose it is an N*M matrix data. All I want is to classify it into, let see, 3 classes. Which method(s) do you think is(are) appropriate for this purpose? Any reference will be welcome! Thanks! Best, Baoqiang Cao
2010 Jun 23
1
Clustering
Hi, I use the following clustering methods and get the corresponding dendrograms for single, complete, average, ward and kmeans clustering. This gives the dendrograms, but doesn't show the calculation-way. My question: is there a possibility to show this calculation steps (cluster steps) in matrix or graphical form? Mit freundlichen Gr??en Ralph Modjesch
2004 Jun 17
1
Re: Clustering in R
Thanks a lot, Michael! I cc to R-help, where this question really belongs {as the 'Subject' suggests itself...} -- please drop 'bioconductor' from CC'ing further replies. >>>>> "michael" == michael watson (IAH-C) <michael.watson at bbsrc.ac.uk> >>>>> on Thu, 17 Jun 2004 09:16:59 +0100 writes: michael> OK, admittedly it
2009 Dec 11
1
cluster size
hi r-help, i am doing kmeans clustering in stats. i tried for five clusters clustering using: kcl1 <- kmeans(as1[,c("contlife","somlife","agglife","sexlife",                         "rellife","hordlife","doutlife","symtlife","washlife",                       
2009 Jun 11
1
Cluster analysis, defining center seeds or number of clusters
I use kmeans to classify spectral events in high and low 1/3 octave bands: #Do cluster analysis CyclA<-data.frame(LlowA,LhghA) CntrA<-matrix(c(0.9,0.8,0.8,0.75,0.65,0.65), nrow = 3, ncol=2, byrow=TRUE) ClstA<-kmeans(CyclA,centers=CntrA,nstart=50,algorithm="MacQueen") This works well when the actual data shows 1,2 or 3 groups that are not "too close" in a cross plot.
2005 Apr 01
4
error in kmeans
I am trying to generate kmean of 10 clusters for a 165 x 165 matrix. i do not see any errors known to me. But I get this error on running the script Error: empty cluster: try a better set of initial centers the commands are M <-matrix(scan("R_mutual",n = 165 * 165),165,165,byrow = T) cl <- kmeans(M,centers=10,20) len = dim(M)[1] .... .... I ran the same script last night and
2011 Sep 13
2
help with hclust and cutree
Hello, I would like to cut a hclust tree into several groups at a specific similarity. I assume this can be achieved by specifying the "h" argument with the specified similarity, e.g.: clust<-hclust(dist,"average") cut<-cutree(clust,h=0.65) Now, I would like to draw rectangles around the branches of the dendrogram highlighting the corresponding clusters, as is done by
2000 Jul 20
3
printing hclust with k clusters
howdy R friends, I've searched CRAN but to no avail... I'm trying to use mva's hclust and print out for say 10 clusters in batch. How do I do this? It's unclear if I can use cutree. thanks, John Strumila -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send
2000 Sep 14
1
Pl. provide and Input for Kmeans
Sir, Would like to know what sort of input matrix are taken by the kmeans function defined in mva library of R application. As per the documentation for the Kmeans it takes the following 2 data sets: 1) data 2) centers The commands to be executed in R are as follows: library(mva) data <- read.table('file1',header=TRUE,sep="\t") centers <-
2013 Aug 22
1
Interpreting the result of 'cutree' from hclust/heatmap.2
I have the following code that perform hiearchical clustering and plot them in heatmap. __ library(gplots) set.seed(538) # generate data y <- matrix(rnorm(50), 10, 5, dimnames=list(paste("g", 1:10, sep=""), paste("t", 1:5, sep=""))) # the actual data is much larger that the above # perform hiearchical clustering and plot heatmap test <- heatmap.2(y)
2003 Apr 14
2
kmeans clustering
Hi, I am using kmeans to cluster a dataset. I test this example: > data<-matrix(scan("data100.txt"),100,37,byrow=T) (my dataset is 100 rows and 37 columns--clustering rows) > c1<-kmeans(data,3,20) > c1 $cluster [1] 1 1 1 1 1 1 1 3 3 3 1 3 1 3 3 1 1 1 1 3 1 3 3 1 1 1 3 3 1 1 3 1 1 1 1 3 3 [38] 3 1 1 1 3 1 1 1 1 3 3 3 1 1 1 1 1 1 3 1 3 1 1 3 1 1 1 1 3 1 1 1 1 1 1 3
2011 Mar 02
2
clustering problem
Hi, I have a gene expression experiment with 20 samples and 25000 genes each. I'd like to perform clustering on these. It turned out to become much faster when I transform the underlying matrix with t(matrix). Unfortunately then I'm not anymore able to use cutree to access individual clusters. In general I do something like this: hc <- hclust(dist(USArrests), "ave")
2006 Aug 07
5
kmeans and incom,plete distance matrix concern
Hi there I have been using R to perform kmeans on a dataset. The data is fed in using read.table and then a matrix (x) is created i.e: [ mat <- matrix(0, nlevels(DF$V1), nlevels(DF$V2), dimnames = list(levels(DF$V1), levels(DF$V2))) mat[cbind(DF$V1, DF$V2)] <- DF$V3 This matrix is then taken and a distance matrix (y) created using dist() before performing the kmeans clustering. My query
2010 May 05
2
custom metric for dist for use with hclust/kmeans
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
2012 Oct 11
2
extracting groups from hclust() for a very large matrix
Hello, I'm having trouble figuring out how to see resulting groups (clusters) from my hclust() output. I have a very large matrix of 4371 plots and 29 species, so simply looking at the graph is impossible. There must be a way to 'print' the results to a table that shows which plots were in what group, correct? I've attached the matrix I'm working with (the whole thing
2006 May 08
1
finding centroids of clusters created with hclust
Hello, Can someone point me to documentation or ideas on how to calculate the centroids of clusters identified with hclust ? I would like to be able to chose the number of clusters (in the style of cutree) and then get the centroids of these clusters. This seems like a quite obvious task to me, but I haven't been able to put my hands on a relevant command. Thank you, Moritz
2004 May 10
3
Colouring hclust() trees
I have a data set with 6 variables and 251 cases. The people who supplied me with this data set believe that it falls naturally into three groups, and have given me a rule for determining group number from these 6 variables. If I do scaled.stuff <- scale(stuff, TRUE, c(...the design ranges...)) stuff.dist <- dist(scaled.stuff) stuff.hc <- hclust(stuff.dist)
2007 Nov 27
2
exporting clustering results to table
Hello list, the following approach did not work: clustersA <- pam(distances, nkA, diss=TRUE); gc(); filenameclu = paste("filenameclu", ".txt"); write.table(clustersA , file=filenameclu,sep=","); although it worked with clustersA <- hclust(distances, method="ward"); and a consecutive kclassA <- cutree(clustersA, k=nkA); filename =