[R] define number of clusters in kmeans/apcluster analysis

2015-12-13 Thread Luigi Marongiu
Dear all, I am trying to do some cluster analysis, both with the base R and the apcluster. Both methods give 2 clusters, which is what I am looking for since I am interested in identifying positive and negative results. However I could not find a way to fine-tuning the analysis in order to

Re: [R] define number of clusters in kmeans/apcluster analysis

2015-12-13 Thread Boris Steipe
You could use the clValid package to run your problem through a variety of different algorithms and evaluate cluster quality, you will learn a lot. https://cran.r-project.org/web/views/Cluster.html gives you many more options. All of the algorithms I am aware of have tunable parameters - but

Re: [R] define number of clusters in kmeans/apcluster analysis

2015-12-13 Thread Bert Gunter
It sounds to me like you don't understand cluster analysis. You should not expect perfect "allocation" of points. I suggest that you consult references in the man pages of your functions or on the web. You might also find it useful to post on stats.stackexchange.com or a machine learning help

Re: [R] how to use confusionMatrix function in solving multi-classes problem

2015-12-13 Thread Giorgio Garziano
You may use the "caret" package. At the following link 2-classes and 3-classes examples: http://www.inside-r.org/node/86995 -- GG [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] define number of clusters in kmeans/apcluster analysis

2015-12-13 Thread William Dunlap
In addition to the other fine replies, you should also know that kmeans's results depend on the relative scales of the data columns (since it is based on distances between points). Your x and y have quite different scales so the distance is essentially determined only by the differences in the

Re: [R] stopifnot with logical(0)

2015-12-13 Thread William Dunlap
> as Bill or Jeff explained, "the empty set is always true" My wording was that any(logical(0)) is FALSE because "there are no TRUEs in logical(0)". Bill Dunlap TIBCO Software wdunlap tibco.com On Sat, Dec 12, 2015 at 1:54 AM, Martin Maechler wrote: >> Henrik

Re: [R] define number of clusters in kmeans/apcluster analysis

2015-12-13 Thread Giorgio Garziano
And in case you would like to explore the supervised clustering approach, I may suggest to explore the use of knn() fed by a training set determined by your cluster assignments expectations. Some "quick code" to show what I mean. z <- as.data.frame(cbind(scale(x), scale(y))) colnames(z) <-

[R] how to use confusionMatrix function in solving multi-classes problem

2015-12-13 Thread Hamed Nofal
Dear Colleagues I need someone to kindly help me solving this problem. A sample of 89 patients was tested for 4 tumor types (T1, T2, T3, T4). The results of the operative predicted T stage and those of the pathology tests are tabulated in the following table:

Re: [R] how to use confusionMatrix function in solving multi-classes problem

2015-12-13 Thread Boris Steipe
This looks like homework to me and this list has a No-Homework policy. Now, once you have done your homework (and that includes reading the documentation of the functions you are using), and you are still confused about details, you are welcome to ask again. Please keep the following in mind:

Re: [R] stopifnot with logical(0)

2015-12-13 Thread peter dalgaard
> On 13 Dec 2015, at 20:31 , William Dunlap wrote: > >> as Bill or Jeff explained, "the empty set is always true" > > My wording was that any(logical(0)) is FALSE because "there are no > TRUEs in logical(0)". Yes. My mind still boggles over how the empty set slipped into