[?] Group or cluster islands of data?

Hi,

I have a data set that shows separate groups or clusters of data. Would like to corral them into distinct clusters and/or find the center of each, but FindClusters doesn’t work very well despite there being a clear separation of these groups. keep in mind I won’t always know how many distinct groups I will have, so an automated form of this is desirable.

I can add various forms of the data set if that would help.

Thanks!

Hi Cole,

Can you provide the list of points corresponding to the plot?

Hi Rohit,

Table is listed below. Note that this is a subset of an array that has {x, y, z} coordinates. Here I’ve just added the x,y coordinates for simplicity. Also, note that (0,0) is an artificial point that I used to clean up the points the fall in between the groups.

{{0, 0}, {1, 4}, {1, 8}, {1, 9}, {1, 10}, {1, 11}, {1, 12}, {1, 
  16}, {1, 17}, {1, 18}, {2, 10}, {2, 11}, {2, 12}, {2, 16}, {2, 
  17}, {2, 18}, {3, 1}, {3, 11}, {3, 12}, {3, 13}, {3, 16}, {3, 
  17}, {3, 18}, {3, 19}, {3, 20}, {3, 21}, {4, 1}, {4, 2}, {4, 6}, {4,
   7}, {4, 13}, {4, 17}, {4, 18}, {4, 19}, {4, 20}, {4, 21}, {5, 
  1}, {5, 2}, {5, 3}, {5, 6}, {5, 7}, {5, 8}, {5, 19}, {5, 20}, {5, 
  21}, {6, 1}, {6, 2}, {6, 3}, {6, 6}, {6, 7}, {6, 8}, {6, 9}, {6, 
  10}, {6, 14}, {6, 21}, {7, 1}, {7, 2}, {7, 3}, {7, 7}, {7, 8}, {7, 
  9}, {7, 10}, {7, 11}, {7, 14}, {7, 15}, {7, 16}, {8, 3}, {8, 8}, {8,
   9}, {8, 10}, {8, 11}, {8, 14}, {8, 15}, {8, 16}, {8, 17}, {8, 
  18}, {9, 10}, {9, 11}, {9, 14}, {9, 15}, {9, 16}, {9, 17}, {9, 
  18}, {9, 19}, {9, 20}, {9, 21}, {10, 5}, {10, 11}, {10, 16}, {10, 
  17}, {10, 18}, {10, 19}, {10, 20}, {10, 21}, {11, 1}, {11, 5}, {11, 
  6}, {11, 7}, {11, 18}, {11, 19}, {11, 20}, {11, 21}, {12, 1}, {12, 
  2}, {12, 5}, {12, 6}, {12, 7}, {12, 8}, {12, 13}, {12, 19}, {12, 
  20}, {12, 21}, {13, 1}, {13, 2}, {13, 5}, {13, 6}, {13, 7}, {13, 
  8}, {13, 9}, {13, 13}, {13, 14}, {13, 15}, {14, 1}, {14, 2}, {14, 
  5}, {14, 6}, {14, 7}, {14, 8}, {14, 9}, {14, 10}, {14, 13}, {14, 
  14}, {14, 15}, {14, 16}, {15, 1}, {15, 2}, {15, 7}, {15, 8}, {15, 
  9}, {15, 10}, {15, 13}, {15, 14}, {15, 15}, {15, 16}, {15, 17}, {15,
   18}, {15, 21}, {16, 1}, {16, 2}, {16, 8}, {16, 9}, {16, 10}, {16, 
  13}, {16, 14}, {16, 15}, {16, 16}, {16, 17}, {16, 18}, {16, 
  21}, {17, 1}, {17, 2}, {17, 9}, {17, 10}, {17, 15}, {17, 16}, {17, 
  17}, {17, 18}, {17, 21}, {18, 5}, {18, 16}, {18, 17}, {18, 18}, {19,
   5}, {19, 6}, {19, 12}, {19, 17}, {19, 18}, {20, 5}, {20, 6}, {20, 
  7}, {20, 8}, {20, 12}, {20, 13}, {21, 1}, {21, 5}, {21, 6}, {21, 
  7}, {21, 8}, {21, 9}, {21, 12}, {21, 13}, {21, 14}, {21, 20}, {21, 
  21}}

Hi Cole,

The Dunn index seems to work fairly well with this set of data. It may of course fail miserably with similar but different data. Need to experiment with the various options FindClusters provides and see what works best. You should also try removing the {0, 0} point. Clustering algorithms avoid clusters of one point so it is going to get pulled into the closest cluster and can potentially impact other clusters.

clusterDunn =  FindClusters[points, PerformanceGoal -> "Quality", CriterionFunction -> "Dunn"];

ListPlot[clusterDunn, PlotMarkers -> {Automatic, 12}]

Thanks Rohit. That is pretty impressive. I appreciate the help.

Best

Are all of your datasets on an exact integer-valued grid?

They can be. The data set starts out as a list of {X, Y, Z} points that represents a square image. I then partition the data to have the {x, y} points that pass my filters.