Re: GSoC project: K-medoids clustering in Madlib - Mailing list pgsql-students

From Atri Sharma
Subject Re: GSoC project: K-medoids clustering in Madlib
Date
Msg-id 2DAD673D-4C46-4039-9D83-AE0D5C16764C@gmail.com
Whole thread Raw
In response to Re: GSoC project: K-medoids clustering in Madlib  (Maxence AHLOUCHE <maxence.ahlouche@gmail.com>)
List pgsql-students


Sent from my iPad

On 20-Apr-2013, at 16:11, Maxence AHLOUCHE <maxence.ahlouche@gmail.com> wrote:

Oops, forgot to attach the output!


2013/4/20 Maxence AHLOUCHE <maxence.ahlouche@gmail.com>
Hi all!

I've had a bit of fun with the k-means clustering, and have made a small script to visualize the result of the classification.
However, I couldn't guess how to assign a cluster to a point from the output of the algorithm, could someone give me an indication, please?

My script is written in python3, and uses py-postgresql (http://python.projects.pgfoundry.org/) as PostgreSQL interface. It also requires Pillow (a PIL fork) which you can find here : https://pypi.python.org/pypi/Pillow/2.0.0.

Before your first use, you may want to change the settings (on top of the file) to connect to your PostgreSQL server.
The script will create a table in your database, populate it with random groups of points, and then call the k-means algorithm on it. Finally, it will generate a PNG image, displaying the points and the centroids.

For a first run, use something like this:
./k-means_test.py --regen -o clustered_data.png

You can call "./k-means_test.py -h" for a list of available options.

In attachment are my script and an example of its output.

By the way, I'll have a lot of work next week, as I have several exams coming and a big project to do (about empirical orthogonal functions), so I'll probably be inactive for a few days! Then I'll be on holidays, so I will be able to focus on  MADlib and GSoC :)

Regards,
Maxence




Very interesting! The results look encouraging,although this is on Python :)

Good work!

Regards,

Atri

pgsql-students by date:

Previous
From: Maxence AHLOUCHE
Date:
Subject: Re: GSoC project: K-medoids clustering in Madlib
Next
From: Atri Sharma
Date:
Subject: Re: GSoC project: K-medoids clustering in Madlib