Implement workphase grouping algorithm (kmeans + best cluster number
choice)