Linear Separation(Matlab) - Page 1
Forum section: electronics / beginners

author: Karamel
author_rank: Regular Contributor
timestamp: October 14, 2017, 05:59:26 pm
content: Hi,I am dealing with clustering and operation of datum. I am,currently , creating and clustering datum which has separated gaussian randomly.Now I would like to split these clusters like below.I have no any idea how can I separate them or how can I search or find a way in order to solve these problem.Can you suggest to me something about this problem, please?

author: orolo
author_rank: Frequent Contributor
timestamp: October 14, 2017, 06:25:00 pm
content: Compute the baricenters (averages) of each data cluster, and then divide the plane with aVoronoi diagram?More advanced, but speculative: computing and diagonalizing the moment of inertia matrix of each cluster, you might find an ellipse concentrating most of the data. You could try growing your Voronoi cells according to these ellipses, to find optimal separation.The sets of points seem convenient in the sense that they are not mixed. In general, you might not be able to separate them with a simple Voronoi diagram.Other idea: if your sets of points are indeed separable by linear segments, computing theconvex hullof the datasets could help.

author: Karamel
author_rank: Regular Contributor
timestamp: October 14, 2017, 07:43:32 pm
content: I must write myself this algorithm. I researched about voronoi function but I didn't get an information how it works.I have an idea. I found centroids of clusters and after I used kmeans algorithm for clusters. Finally I found edge of clusters.There is just one bad point that I can give logical points. I am finding them with all combination of each centroid. For example, between 2 and 4, the program has given a edge inside of 3 named cluster.How can I do these in order to better approximation?

author: orolo
author_rank: Frequent Contributor
timestamp: October 14, 2017, 08:38:50 pm
content: Try Fortune's algorithm using the centroids.Here is a Python implementation(based on a C++ one) that works right out of the box for me. It could be a starting point for your own algorithm.The idea could be:1) Use k-means to find centroids of clusters.2) Use Fortune's to find Voronoi diagram.3) Classify points based on Voronoi diagram (points already classified by closest centroid, really).Attached a picture of the python Fortune's program with your clusters in the background to compare.

author: Karamel
author_rank: Regular Contributor
timestamp: October 14, 2017, 09:26:42 pm
content: I can find quickly Voronoi of clusters with Voronoi function but I want to implement this function.My approach looks a little bit good but not enough. Voronoi makes something different and gets the exact solution. My algorithm is still bad.have you god any idea to imitate voronoi?

author: orolo
author_rank: Frequent Contributor
timestamp: October 14, 2017, 10:01:36 pm
content: I see. You are computing the middle point between centroids. As you can see, if the centroids are closest neighbours, the middle point will be in the Voronoi diagram, and the dividing line will be perpendicular to the segment joining the centroids. Using this simple fact you could guess many of the frontier lines and, intersecting them, get many vertices of the Voronoi diagram. However, I doubt this method will be more effective or comprehensive than the one I mentioned above.It seems to me that, once you run out of closest neighbours, you could get to 'next closest neighbours' meaning by that pairs of points that are not occluded (topologically unconnected) by lines and vertices obtained in previous iterations. Maybe this way you could get a complete Voronoi diagram. Like building a fence little by little.Something like the images attached below, though this might require much refining and dealing with hairier configurations.

author: Karamel
author_rank: Regular Contributor
timestamp: October 15, 2017, 09:37:42 pm
content: Thank you so muchorolo. You have shown a way to find solution for me.Best RegardsKaramel