/// <summary> /// Count how many of the two clusters are outliers. /// /// NOTE: It may be necessary to call Relabel first if any merges have occurred since this object was created, /// since Point1 and Point2 mayh now be in different clusters than before. /// </summary> /// <param name="clusters">Current clustering of points.</param> /// <param name="maxOutlierSize">Any cluster whose size does not equal or exceed this value is an outlier.</param> /// <returns>Zero if neither cluster is an outlier, otherwise one or two.</returns> public int CountOutliers(Classification <UnsignedPoint, TLabel> clusters, int maxOutlierSize) { var size1 = clusters.PointsInClass(Color1).Count; var size2 = clusters.PointsInClass(Color2).Count; return((size1 < maxOutlierSize ? 1 : 0) + (size2 < maxOutlierSize ? 1 : 0)); }
public RadiusMergeCandidate( Classification <UnsignedPoint, string> clusters, string label1, ClusterRadius radius1, string label2, ClusterRadius radius2 ) { Label1 = label1; Point1 = clusters.PointsInClass(Label1).First(); Label2 = label2; Point2 = clusters.PointsInClass(Label2).First(); CombinedRadius = new ClusterRadius(clusters.PointsInClass(Label1), clusters.PointsInClass(Label2)); Shrinkage = CombinedRadius.Shrinkage(radius1, radius2); }