Displaying 20 results from an estimated 20000 matches similar to: "how to find the number of iterations kmeans used to converge?"
2006 Mar 30
2
kmeans: "did not converge in 10 iterations"
Hi All,
I run function "kmeans" to cluster a matrix. But when the matrix size is
big enough, it keeps saying "did not converge in 10 iterations". Could
you explain what it means and if the result is wrong?
And the interesting thing is sometimes this warning happens when the
sample size is around 51200 x 6, sometimes it happens around 30000 x 6.
Does the warning related
2012 Jan 14
1
Error: unexpected '<' in "<" when modifying existing functions
Hi.
I am trying to modify kmeans function.
It seems that is failing something obvious with the workspace.
I am a newbie and here is my code:
myk = function (x, centers, iter.max = 10, nstart = 1, algorithm =
c("Hartigan-Wong",
+ "Lloyd", "Forgy", "MacQueen"))
+ {
+ do_one <- function(nmeth) {
+ Z <- switch(nmeth, {
+ Z
2012 Feb 29
3
Does anyone knows a KMeans ++ package for R?
Dear all.
I am searching for KMeans ++ for R. I cannot find it.
Do you know any package with it?
Best regards,
Rui
2011 Oct 17
2
Foreach (doMC)
Hello,
I am trying to run a small example with foreach, but I am having some
problems. Here is the code:
*library(doMC)
registerDoMC()
zappa = list()
frank = list()
foreach (i = 1:4) %dopar% {
zappa[[i]] = kmeans (iris[-5],4)
frank[[i]] = warnings()
}*
The code runs without error. However the zappa and frank will be empty
lists.
If I use regular *for *instead, the list will be filled up
2006 Apr 07
2
cclust causes R to crash when using manhattan kmeans
Dear R users,
When I run the following code, R crashes:
require(cclust)
x <- matrix(c(0,0,0,1.5,1,-1), ncol=2, byrow=TRUE)
cclust(x, centers=x[2:3,], dist="manhattan", method="kmeans")
While this works:
cclust(x, centers=x[2:3,], dist="euclidean", method="kmeans")
I'm posting this here because I am not sure if it is a bug.
I've been searching
2010 Dec 02
1
kmeans() compared to PROC FASTCLUS
Hello all,
I've been comparing results from kmeans() in R to PROC FASTCLUS in SAS and
I'm getting drastically different results with a real life data set. Even
with a simulated data set starting with the same seeds with very well
seperated clusters the resulting cluster means are still different. I was
hoping to look at the source code of kmeans(), but it's in C and FORTRAN and
2013 Mar 13
1
Empty cluster / segfault using vanilla kmeans with version 2.15.2
Hello,
here is a working reproducible example which crashes R using kmeans or
gives empty clusters using the nstart option with R 15.2.
library(cluster)
kmeans(ruspini,4)
kmeans(ruspini,4,nstart=2)
kmeans(ruspini,4,nstart=4)
kmeans(ruspini,4,nstart=10)
?kmeans
either we got empty always clusters and or, after some further commands
an segfault.
regards,
Detlef Groth
------------
[R] Empty
2016 Aug 15
2
KMeans - Evaluation Results
Hello,
I've recently finished with an implementation of KMeans with two
initialization techniques, random initialization and KMeans++. I would like
to share my findings after evaluating the same.
I have tested this implementation of KMeans with a BBC news article
dataset. I am currently working on evaluating the same with FIRE datasets.
Currently, clustering more than 500 documents
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
2013 Feb 03
1
Empty cluster / segfault using vanilla kmeans with version 2.15.2
Dear experts,
I am encountering a version-dependent issue.
My laptop runs Ubuntu 12.04 LTS 64-bit, R 2.14.1; the issue explained below
never occurred with this version of R
My desktop runs Ubuntu 11.10 64-bit, R 2.13.2; what follows applies to this
setup.
The data I'm clustering is constituted by the rows of a 320 x 6 matrix
containing integers ranging from 1 to 7, no missing data.
I applied
2011 Apr 06
2
Help in kmeans
Hi All,
I was using the following command for performing kmeans for Iris dataset.
Kmeans_model<-kmeans(dataFrame[,c(1,2,3,4)],centers=3)
This was giving proper results for me. But, in my application we generate
the R commands dynamically and there was a requirement that the column names
will be sent instead of column indices to the R commands.Hence, to
incorporate this, i tried using the R
2003 Jun 05
1
kmeans (again)
Regarding a previous question concerning the kmeans function I've tried the
same example and I also get a strange result (at least according to what is
said in the help of the function kmeans). Apparently, the function is
disregarding the initial cluster centers one gives it. According to the help
of the function:
centers: Either the number of clusters or a set of initial cluster
2010 Jan 11
1
K-means recluster data with given cluster centers
K-means recluster data with given cluster centers
Dear R user,
I have several large data sets. Over time additional new data sets will be created.
I want to cluster all the data in a similar/ identical way with the k-means algorithm.
With the first data set I will find my cluster centers and save the cluster centers to a file [1].
This first data set is huge, it is guarantied that cluster
2004 May 11
1
AW: Probleme with Kmeans...
Sorry, to solve your question I had tried:
data(faithful)
kmeans(faithful[c(1:20),1],10)
Error: empty cluster: try a better set of initial centers
But when I run this a second time it will be ok.
It seems, that kmeans has problems to initialize good starting points, because of the random choose of these starting initial points.
With kmeans(data,k,centers=c(...) the problem can be solved.
2006 Jul 09
2
distance in kmeans algorithm?
Hello.
Is it possible to choose the distance in the kmeans algorithm?
I have m vectors of n components and I want to cluster them using kmeans
algorithm but I want to use the Mahalanobis distance or another distance.
How can I do it in R?
If I use kmeans, I have no option to choose the distance.
Thanks in advance,
Arnau.
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
2012 Feb 27
2
kmeans: how to retrieve clusters
Hello,
I'd like to classify data with kmeans algorithm. In my case, I should get 2
clusters in output. Here is my data
colCandInd colCandMed
1 82 2950.5
2 83 1831.5
3 1192 2899.0
4 1193 2103.5
The first cluster is the two first lines
the 2nd cluster is the two last lines
Here is the code:
x = colCandList$colCandInd
y = colCandList$colCandMed
m = matrix(c(x, y),
2009 Jul 20
2
kmeans.big.matrix
Hi,
I'm playing around with the 'bigmemory' package, and I have finally
managed to create some really big matrices. However, only now I
realize that there may not be functions made for what I want to do
with the matrices...
I would like to perform a cluster analysis based on a big.matrix.
Googling around I have found indications that a certain
kmeans.big.matrix() function should
2001 Aug 01
2
clustering question ... hclust & kmeans
I am using R 1.3.0 on Windows 2000.
For an experiment, I am wanting to find the most diverse 400 items to
study in a possible 3200 items. Diversity here is based on a few
hundred attributes. For this, I would like to do a clustering analysis
and find 400 clusters (i.e. different from each other in some way
hopefully). From each of these 400 clusters, I will pick a
representative. I expect
2003 Jun 06
1
Kmeans again
Dear helpers
I'm sorry to insist but I still think there is something wrong with the function kmeans. For instance, let's try the same small example:
> dados<-matrix(c(-1,0,2,2.5,7,9,0,3,0,6,1,4),6,2)
I will choose observations 3 and 4 for initial centers and just one iteration. The results are
> A<-kmeans(dados,dados[c(3,4),],1)
> A
$cluster
[1] 1 1 1 1 2 2
$centers