Hello,
It's my first post here, please bear with me :-) Problem: Sort strings into clusters, and plot them (in addition to regular output).
Example strings:
american muscle cars ny
mustang american car
american car loans
american car makers CA
muscle car show
car makers in detroit
corvette collectible edition car
california big cadillac car sale
I'd like to ask about the best approach for this. Since there are +9k strings as the above, there must be a clever way to go about it and produce decent results. So in seek for cleverness, I came here :-)
My thoughts so far:
* loaded the file to cell array.
* removed commonly used words (such as the/in/is/etc) to remove their weight.
* I was thinking to use levenshtein_distance but it only compares one string to the other. This means that if I compare 9k entries to each other, then the resulting matrix will be 9k*9k. Is this efficient? But I'm not aware of other ways to quantify the distance between two strings.
* Then I thought about using kmeans(X,k) to go over the new 9k*9k matrix and measure the distance and cluster.
I've found this article, but it's rather brief: http://makarandtapaswi.wordpress.com/2011/06/14/clustering-and-matlab/ And also the discussion here: http://stackoverflow.com/questions/3646169/clustering-text-in-matlab
I'd appreciate any input you have/ references/examples.
It's my first post here, please bear with me :-) Problem: Sort strings into clusters, and plot them (in addition to regular output).
Example strings:
american muscle cars ny
mustang american car
american car loans
american car makers CA
muscle car show
car makers in detroit
corvette collectible edition car
california big cadillac car sale
I'd like to ask about the best approach for this. Since there are +9k strings as the above, there must be a clever way to go about it and produce decent results. So in seek for cleverness, I came here :-)
My thoughts so far:
* loaded the file to cell array.
* removed commonly used words (such as the/in/is/etc) to remove their weight.
* I was thinking to use levenshtein_distance but it only compares one string to the other. This means that if I compare 9k entries to each other, then the resulting matrix will be 9k*9k. Is this efficient? But I'm not aware of other ways to quantify the distance between two strings.
* Then I thought about using kmeans(X,k) to go over the new 9k*9k matrix and measure the distance and cluster.
I've found this article, but it's rather brief: http://makarandtapaswi.wordpress.com/2011/06/14/clustering-and-matlab/ And also the discussion here: http://stackoverflow.com/questions/3646169/clustering-text-in-matlab
I'd appreciate any input you have/ references/examples.