I think it is pretty standard, iterated, k-means clustering. I think what you’re looking at is the entire algorithm here. I’m sure that you can dive into it and find the hyperparameters and parameters to this algorithm. I think the pol.is team did not deviate from the standard statistics or mathematics at all when coding this part.