public List <Sign> TeachClassifier()
        {
            bool needToRepeat = true;
            int  count        = 0;

            while (needToRepeat)
            {
                Partition();
                foreach (Cluster cluster in ClusterList)
                {
                    Sign   newCenterElement = cluster.FindCenterElement();
                    double dist             = Sign.GetDistance(cluster.Center, newCenterElement);
                    if (dist >= this.Accuracy)
                    {
                        newCenterElement.ClusterNumber = cluster.Number;
                        cluster.Center = newCenterElement;
                        count++;
                    }
                }
                if (count == 0)
                {
                    needToRepeat = false;
                }
                count = 0;
            }
            List <Sign> result = new List <Sign>();

            foreach (Cluster cl in this.ClusterList)
            {
                result.Add(cl.Center);
            }
            return(result);
        }
Ejemplo n.º 2
0
 public double GetDistanceToCenter(Sign element)
 {
     return(Sign.GetDistance(Center, element));
 }