# Clusterer - 0.1.0 first release

**URL:** <https://www.ruby-forum.com/t/clusterer-0-1-0-first-release/65994>\
**Category:** Ruby\
**Created:** [August 22, 2006, 7:53pm UTC](https://www.ruby-forum.com/t/clusterer-0-1-0-first-release/65994 "2006-08-22T19:53:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![surendra\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@surendra\_s](https://www.ruby-forum.com/u/surendra_s)\
**Post date:** [August 22, 2006, 7:53pm UTC](https://www.ruby-forum.com/t/clusterer-0-1-0-first-release/65994/1 "2006-08-22T19:53:25Z")

</div>

Hello,

I am pleased to announce the availability of the Ruby library  
‘clusterer’  
which implements the basic K-Means and Hierarchical Clustering  
algorithms for  
text data.

The project Rubyforge page is:

[http://rubyforge.org/projects/clusterer/](http://rubyforge.org/projects/clusterer/)

The library can be installed using:

gem install clusterer

More information can be found in the following blog entry:

[http://cuttingtheredtape.blogspot.com/2006/08/ruby-clustering-library-for-text-data.html](http://cuttingtheredtape.blogspot.com/2006/08/ruby-clustering-library-for-text-data.html)

Happy hacking.

–  
Surendra S.  
[http://ssinghi.kreeti.com](http://ssinghi.kreeti.com), [http://www.kreeti.com](http://www.kreeti.com)  
Read my blog at: [http://cuttingtheredtape.blogspot.com/](http://cuttingtheredtape.blogspot.com/)  
,----  
| “All animals are equal, but some animals are more equal than others.”  
| – Orwell, Animal Farm, 1945  
`----

---

<div class="post-metadata">

**Author:** ![surendra\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@surendra\_s](https://www.ruby-forum.com/u/surendra_s)\
**Post date:** [August 22, 2006, 8:19pm UTC](https://www.ruby-forum.com/t/clusterer-0-1-0-first-release/65994/2 "2006-08-22T20:19:28Z")

</div>

On 8/22/06, Surendra S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am pleased to announce the availability of the Ruby library ‘clusterer’  
> which implements the basic K-Means and Hierarchical Clustering algorithms for  
> text data.

I’ve installed the gem but am not getting very good results with my  
limited use. In particular, I tried the example you posted on your  
blog:

```
Clusterer::Clustering.kmeans_clustering(["hello world","mea

```

culpa",“goodbye world”])

but it appears to have placed all three strings in the same cluster;  
the result was [[0, 1, 2]]. I get a similar result ([[1, 0, 2]]) if I  
try the hierarchical clustering instead.

This is on Mac OS X 10.4, running Ruby 1.8.4.

---

<div class="post-metadata">

**Author:** ![surendra\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@surendra\_s](https://www.ruby-forum.com/u/surendra_s)\
**Post date:** [August 23, 2006, 12:01pm UTC](https://www.ruby-forum.com/t/clusterer-0-1-0-first-release/65994/3 "2006-08-23T12:01:04Z")

</div>

On Tuesday 22 August 2006 18:51, Surendra S. wrote:

> The library can be installed using:
> 
> gem install clusterer
> 
> More information can be found in the following blog entry:
> 
> [http://cuttingtheredtape.blogspot.com/2006/08/ruby-clustering-library-for-t](http://cuttingtheredtape.blogspot.com/2006/08/ruby-clustering-library-for-t)  
> ext-data.html
> 
> Happy hacking.

This looks very interesting, great work.

Alex

---

<div class="post-metadata">

**Author:** ![surendra\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@surendra\_s](https://www.ruby-forum.com/u/surendra_s)\
**Post date:** [August 23, 2006, 3:13pm UTC](https://www.ruby-forum.com/t/clusterer-0-1-0-first-release/65994/4 "2006-08-23T15:13:23Z")

</div>

Hello,

“Lyle J.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> Clusterer::Clustering.kmeans\_clustering([“hello world”,“mea  
> culpa”,“goodbye world”])
> 
> but it appears to have placed all three strings in the same cluster;  
> the result was [[0, 1, 2]]. I get a similar result ([[1, 0, 2]]) if I  
> try the hierarchical clustering instead.

The examples were just to show how to use the algorithms.

Clustering can also be thought of as a problem where you are looking for  
representative points for a given set of points, if you want to preserve  
all  
the information you can have every point as a cluster, or if you want  
maximum  
compression, then just have one cluster. So, there is a trade-off.

Here I choose the default number of clusters equal to Math.sqrt(no. of  
docs),  
and with the example it reduces to integer 1, and hence one cluster.

If you want custom number of clusters, then use

Clusterer::Clustering.kmeans\_clustering([“hello world”,“mea  
culpa”,“goodbye world”],2)

and also use it on a larger corpus to really evaluate the merit of the  
algorithms.

The algorithms may also need some additional customisation depending  
upon the  
problem domain.

## Cheers,

Surendra S.  
[http://ssinghi.kreeti.com](http://ssinghi.kreeti.com), [http://www.kreeti.com](http://www.kreeti.com)  
Read my blog at: [http://cuttingtheredtape.blogspot.com/](http://cuttingtheredtape.blogspot.com/)  
,----  
| By all means marry; if you get a good wife, you’ll be happy. If you  
| get a bad one, you’ll become a philosopher.  
| – Socrates  
`----
