Hi , how to extract the cluster points collection of lat long after using the PointClusterer ?
Here's an option if you don't want to implement a different clustering algorithm that allows you to specify the cluster membership rather than the number of clusters.
With the assumption that you want the fewest number of clusters without exceeding a maximum value for the members of each cluster (MaxNo)
The minimum number of clusters is ceiling(TotalPoints/MaxNo).
Set that value to the PointClusterer transformer, check the number of members in each cluster, if any cluster exceeds the MaxNo, increase the number of clusters by one, and rerun the PointClusterer with the new number of clusters.
Repeat this loop until all clusters are under MaxNo.
The PointClusterer custom transformer on the hub requires the number of clusters to be defined.
You generally can't constrain both the number of clusters and the maximum size of the cluster, because you'll run into errors if your number of points exceeds the product of the two.
That said, for univariate k-means clustering, we've had reasonable success in using both R ((Ckmeans.1d.dp)) and Python to create 'optimized clustering' defining a minimum and maximum number of clusters, and/or cluster size and looping through the possibilities, rejecting those that exceed the constraints, and then selecting the optimised cluster based on additional criteria.
It should be fairly straightforward to replace the ckmeans.1d.dp with a 2d k-means classifier.
Did you download the template transformer and changed the option Number of Cluster?
Thanks,
Danilo
Hi @bishoymf
I believe that this article can be helpful for you https://knowledge.safe.com/idea/59941/k-means-point-clustering-using-fme.html
Thanks,
Danilo