Closed smaniu closed 6 years ago
The following code appears in several methods in the implementation of Clustream and StreamKM:
val assignedCl = getClusters.foldLeft((0,Double.MaxValue,0))( (cl,centr) => { val dist = centr.in.distanceTo(x.in) if(dist<cl._2) ((cl._3,dist,cl._3+1)) else ((cl._1,cl._2,cl._3+1)) })._1
I suggest creating a ClusteringUtils object in which we put general methods like this, to avoid repetition and possible bugs due to changes.
The following code appears in several methods in the implementation of Clustream and StreamKM:
I suggest creating a ClusteringUtils object in which we put general methods like this, to avoid repetition and possible bugs due to changes.