LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Clustering - K-means algorithm

    Employee
    Posted 09-05-2013 07:57

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Theo

    Hello again. This will be a bit tricky to describe.
    I need some help concerning a clustering algorithm (2-d/Cartesian x-y coordinates) I am trying to set up.

    The basic thinking process/principle behind it can be found here: en.wikipedia.org/wiki/K-means_clustering

    I had initiated some attempts which led me to a very rough outcome presented in the attached graph. Clusterization_JA.brg

    I would like to request some additional help for the development of the following (which is not included in my graph yet):
    1) I would eventually like to make a dynamic iterative process that when a new static point (cartesians x,y) is assigned to an existing cluster via a criterion
    (usually Euclidian Distance between the cluster Centroid and the point itself), all the cluster's centroids are recalculated and all past-processed points are re-assigned until no other point
    (from the already processed ones) will be changed. From then on, one new point will be inserted in the processing algorithm and the aforementioned step will have to be executed again.
    let me formulate an example.
    When I have a set of e.g. 3 clusters (with their respective Centroids and their coordinates set) and I have already assigned 1 point to one of them (e.g. Cluster 1),
    when I process the second one and initially assign it to e.g. cluster 2, this cluster's centroid coordinates will have to change accordingly. Before proceeding to the next static point
    (Point 3), I want to check if the previously processed static Point (Point 1) does still belong to Cluster1 or it is now closer to (new)Cluster2. If the latter happens, then assign it to
    (new)Cluster2 and iterate the process until no other point from the already processed (Point 1 and Point 2 so far) needs to move to another cluster.
    Then Proceed with Point 3.
    [iterate]

    2) In the provided graph I have some arbitrarily set clusters' centroids.
    At the first branch I have set as the Clusters' initial Centroid the first i (where i=user defined cluster number) Points and proceeded with the processing of the rest.
    At the second branch I have derived the Min and Max of the Given Points' Coordinates (X,Y) and create the relevant centroids with the formula CENTROIDi((MAXC-MINX)/i,(MAXy-MINy)/i)

    3) I would eventually like to create a form of Bubble+Scatter Diagram with bubbles representing clusters (and their size will be analogous to the number of points they contain) and scatter points representing the Initially Given (X-Y coordinates) Points.

    That was all,
    Thank you in advance and please forgive me for the long post.


  • 2.  RE: Clustering - K-means algorithm

    Employee
    Posted 09-05-2013 08:16

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Theo

    As a follow-up question and regarding my second (2) point, I would like to ask for recommendations concerning the initialization of centroids as the process heavily relies on the initial Centroids and is generally prone to GarbageIn-GarbageOut data...
    Thanks again,
    Theo


  • 3.  RE: Clustering - K-means algorithm

    Employee
    Posted 09-05-2013 19:14

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: johnpelz

    Hi Theo,

    We're actually in the process of developing a K-Means Clustering node right node and while it's still in the development stage and not ready for public consumption, we're happy to share the current prototype version with you. This IS a prototype so please treat it as such. We welcome any feedback and if it suits your immediate needs, feel free to continue to use it. Below are some instructions:

    1. Attached is the actual graph with the K-Means node & an example test case
    2. The node requires a distribution of the free NumPy python library deployed to <lavastorm install path>/lib/python/. As an example : C:\Program Files (x86)\Lavastorm\LAE 4.6\lib\python\numpy

    Unfortunately, the distribution is too large to post on the forums, so I have posted it to the following link for you to download.
    http://www.lavastorm.com/assets/numpy.rar

    Thanks
    Attachments:
    kmeans.v.2.brg