#NEWLINE# @ classmethod #NEWLINE# def repartition_with_kmedoids( cls , initial_cluster , k , submatrix ) : #NEWLINE# #INDENT# partitioned_clustering = cls . KMedoidsAlgorithmClass ( submatrix ) . perform_clustering ( { #NEWLINE# #INDENT# 'k' : k , #NEWLINE# 'seeding_type' : 'RANDOM' , #NEWLINE# 'tries' : 10 , #NEWLINE# #UNINDENT# } ) #NEWLINE# remapped_clusters = [ ] #NEWLINE# for partitioned_cluster in partitioned_clustering . clusters : #NEWLINE# #INDENT# remapped_clusters . append ( cls . redefine_cluster_with_map ( initial_cluster , partitioned_cluster ) ) #NEWLINE# #UNINDENT# return Clustering ( remapped_clusters )