private void InitClusterPoints()
        {
            Clusters.ForEach((cluster) => {
                cluster.Points = Points.Where(p => p.Cluster.ClusterID == cluster.ClusterID).ToList();
                SeriesCollection.ElementAt(cluster.ClusterID).Values.AddRange(new List <ScatterPoint>()
                {
                    new ScatterPoint(cluster.AttrX, cluster.AttrY, clusterWeight)
                });
            });

            Clusters.ForEach((cluster) =>
            {
                cluster.NbPoints = cluster.Points.Count();
                cluster.Points.ForEach((point) =>
                {
                    point.CalculateSilhouette(Points, DistanceAlgorithm);
                });
            });

            Clusters.ForEach((cluster) =>
            {
                cluster.CalculateSilhouettePercentage();
                SilhouettePercentage = (SilhouettePercentage + cluster.SilhouettePercentage) / 2;
            });
        }
        private void RepositionClusters()
        {
            List <bool> States = new List <bool>();

            Clusters.ForEach((cluster) => {
                States.Add(
                    cluster.Reposition(Points.Where(p => p.Cluster.ClusterID == cluster.ClusterID).ToList())
                    );
            });
            if (States.Where(s => s == true).Count() != 0)
            {
                SetClusterForEachPoint();
            }
        }
Exemplo n.º 3
0
 public void AfterLoad()
 {
     Clusters.AddHandlers(this, ClusterAdded, ClustersChanged, ClusterRemoved);
     Instances.AddHandlers(this, InstanceAdded, InstancesChanged, InstanceRemoved);
     Clusters.ForEach(c => c.AfterLoad());
 }