Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UTXPG-0002jd-OV for pgsql-students@arkaria.postgresql.org; Sat, 20 Apr 2013 13:00:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UTXPG-0004Ax-3v for pgsql-students@arkaria.postgresql.org; Sat, 20 Apr 2013 13:00:42 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UTXPF-0004Ar-1g for pgsql-students@postgresql.org; Sat, 20 Apr 2013 13:00:41 +0000 Received: from mail-pd0-f182.google.com ([209.85.192.182]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UTXPB-0001nj-Sp for pgsql-students@postgresql.org; Sat, 20 Apr 2013 13:00:40 +0000 Received: by mail-pd0-f182.google.com with SMTP id 3so2713900pdj.27 for ; Sat, 20 Apr 2013 06:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=yglpRLExNPbT8n3peLHMgfk2GCmo2+C2Up4pK7qjJVE=; b=Sj7COwZa4LJTEc8OsLUTvByuK+fjxEDWgV5ruPb/SvfvFHRcvDaLZwAc/7gC2ZaYrm G8Yg+cmXENMrsPebNWV9cfV2sHSBPSGgY+wy6WQhQT3rtoeal3tMVSXHuwoyf7isLZNu EhTx4Y9aaYRHo74q1j0OtS2L2IIATG3z2jacwnlQ9psPRwzC3ZKk0VMy3wbUx3hv7uec 3h1fg+fE2Zz15xnKpGEf8rZ58AJzqpuC1DE3H9BwXTABYtNlolWVBb8o8y2mQTIISxkg q1RzO/vmtMPEaF6/b5vC/9zC5OfxCLKiJOCt+jBdCwxYl1eLFicv6zUJ6JTSp54OD2G7 51lg== X-Received: by 10.68.252.201 with SMTP id zu9mr7118367pbc.119.1366462836129; Sat, 20 Apr 2013 06:00:36 -0700 (PDT) Received: from [192.168.1.2] ([122.177.201.150]) by mx.google.com with ESMTPS id cp1sm17131476pbc.42.2013.04.20.06.00.31 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Apr 2013 06:00:34 -0700 (PDT) References: <7F4B7333-168C-4CFC-BBAF-E6B374273134@emc.com> Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: multipart/alternative; boundary=Apple-Mail-E1AB8606-59EE-4329-8D02-567055F647A8 Content-Transfer-Encoding: 7bit Message-Id: <2DAD673D-4C46-4039-9D83-AE0D5C16764C@gmail.com> Cc: "Iyer, Rahul" , "pgsql-students@postgresql.org" , "devel@madlib.net" , "Philip, Sujit" X-Mailer: iPad Mail (10A523) From: Atri Sharma Subject: Re: GSoC project: K-medoids clustering in Madlib Date: Sat, 20 Apr 2013 18:30:31 +0530 To: Maxence AHLOUCHE X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-students Precedence: bulk Sender: pgsql-students-owner@postgresql.org --Apple-Mail-E1AB8606-59EE-4329-8D02-567055F647A8 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Sent from my iPad On 20-Apr-2013, at 16:11, Maxence AHLOUCHE wrot= e: > Oops, forgot to attach the output! >=20 >=20 > 2013/4/20 Maxence AHLOUCHE >> Hi all! >>=20 >> I've had a bit of fun with the k-means clustering, and have made a small s= cript to visualize the result of the classification. >> However, I couldn't guess how to assign a cluster to a point from the out= put of the algorithm, could someone give me an indication, please? >>=20 >> My script is written in python3, and uses py-postgresql (http://python.pr= ojects.pgfoundry.org/) as PostgreSQL interface. It also requires Pillow (a P= IL fork) which you can find here : https://pypi.python.org/pypi/Pillow/2.0.0= . >>=20 >> 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 g= roups of points, and then call the k-means algorithm on it. Finally, it will= generate a PNG image, displaying the points and the centroids. >>=20 >> For a first run, use something like this: >> ./k-means_test.py --regen -o clustered_data.png >>=20 >> You can call "./k-means_test.py -h" for a list of available options. >>=20 >> In attachment are my script and an example of its output. >>=20 >> By the way, I'll have a lot of work next week, as I have several exams co= ming 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 :) >>=20 >> Regards, >> Maxence >>=20 >>=20 >>=20 Very interesting! The results look encouraging,although this is on Python :)= Good work! Regards, Atri= --Apple-Mail-E1AB8606-59EE-4329-8D02-567055F647A8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit


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
--Apple-Mail-E1AB8606-59EE-4329-8D02-567055F647A8--