Skip to main content
13 events
when toggle format what by license comment
Jan 20, 2017 at 15:08 comment added Bryan Goggin strictly positive values
Jan 20, 2017 at 1:27 comment added Han Are both the x axis and y axis euclidian distances between the words in the document. How can there be negative values?
Jul 2, 2016 at 20:23 history migrated from stackoverflow.com (revisions)
Jun 26, 2016 at 20:54 comment added Has QUIT--Anony-Mousse It will mistakenly lead people to believe that k-means works on distance matrixes. It should be made clear that k-means expects to see the raw data, not a distance matrix. Otherwise you don't get e.g. a centroid.
Jun 26, 2016 at 14:38 comment added Bryan Goggin Thanks for down-voting my answer for a completely off topic reason. I was answering Doug's question, as asked, about the article's code and the use of dist function. If you have a problem with how the article uses k-means then take that up with them.
Jun 26, 2016 at 8:23 comment added Has QUIT--Anony-Mousse kneans should be run on the data matrix. Running it on the distance matrix has a different semantic, does not yield meaningful centers, and is O(n^2), i.e. much more expensive and will not scale.
Jun 24, 2016 at 3:30 vote accept Doug Fir
Jun 24, 2016 at 3:29 comment added Doug Fir Can't underline enough how helpful this has been. I get it now - thank you so much. You're last comment above really nails where I was getting confused
Jun 24, 2016 at 2:26 comment added Bryan Goggin In the first example (the quick brown fox, etc) there are 6 possible dimensions. However, for the dimension "the" both vectors have the value of 1. So the formula would be the square root of (1-1)^2 ("the") + (1-0)^2 ("quick")+ ... +(0-1)^2 ("dog") which is sqrt(0+1+1+1+1+1) = sqrt(5) = 2.236068.
Jun 24, 2016 at 2:17 comment added Doug Fir Thanks, this is very helpful. A small follow up, if you will. In the first matrix you showed distance between V1 and V2 dist(words) as 2.23. Looking at the distance formula at the top of the answer, how did that come to be? I tried √4 ( which is 2) minus √3 (which is 1.73) = 0.27. √4 and 3 because the formula √x1 +xn. How would one calculate the 2.23 distance? Again, really grateful for your time in explaining this so far
Jun 24, 2016 at 1:49 comment added Bryan Goggin I edited my answer. Hopefully that helps.
Jun 24, 2016 at 0:36 comment added Doug Fir Thanks for taking the time to answer. "The function dist computed the euclidean distance between vectors". At the point d is created d <- dist(t(dtmss), method="euclidian"), what is the vector(s) at this point in time? I looked at head(d) str(d) and it's a class object. The first value in there on my actual data is 68.19091 and the label is "someword". What does that mean? What is 68.19091 in this context? My cognitive abilities are just not sharp enough
Jun 24, 2016 at 0:19 history answered Bryan Goggin CC BY-SA 3.0