Beispiel #1
0
        private void DrawLearningDataSetButton_Click(object sender, RoutedEventArgs e)
        {
            if (data != null)
            {
                ValuesA.Clear();
                ValuesB.Clear();
                ValuesC.Clear();
                ValuesD.Clear();

                data.ForEach(i =>
                {
                    switch (i.ObjClass)
                    {
                    case 0: ValuesA.Add(new ObservablePoint(i.Attributes[0], i.Attributes[1])); break;

                    case 1: ValuesB.Add(new ObservablePoint(i.Attributes[0], i.Attributes[1])); break;
                    }
                });

                stolp.stolp(data, int.Parse(deltaTextBox.Text), int.Parse(l0TextBox.Text)).ForEach(i =>
                {
                    ValuesC.Add(new ObservablePoint(i.Attributes[0], i.Attributes[1]));
                });

                List <Data> standarts = new List <Data>();
                standarts.AddRange(stolp.findStandard(stolp.emissionСutOff(data, int.Parse(deltaTextBox.Text))));
                //standarts.AddRange(stolp.findStandard(data));

                standarts.ForEach(i =>
                {
                    ValuesD.Add(new ObservablePoint(i.Attributes[0], i.Attributes[1]));
                });
            }
        }
Beispiel #2
0
        private void ClassificateButton_Click(object sender, RoutedEventArgs e)
        {
            if (data != null)
            {
                ValuesA.Clear();
                ValuesB.Clear();
                ValuesC.Clear();
                ValuesD.Clear();

                List <Data> newData      = new List <Data>();
                List <Data> omega        = stolp.stolp(data, int.Parse(deltaTextBox.Text), int.Parse(l0TextBox.Text));
                int         maxItemCount = int.Parse(count.Text);

                for (int i = 0; i < maxItemCount; i++)
                {
                    for (int j = 0; j < maxItemCount; j++)
                    {
                        Data obj = new Data(new double[] { i / (double)maxItemCount, j / (double)maxItemCount }, -1);
                        obj.ObjClass = stolp.classifier(omega, obj);
                        switch (obj.ObjClass)
                        {
                        case 0: ValuesA.Add(new ObservablePoint(obj.Attributes[0], obj.Attributes[1])); break;

                        case 1: ValuesB.Add(new ObservablePoint(obj.Attributes[0], obj.Attributes[1])); break;
                        }
                        newData.Add(obj);
                    }
                }

                stolp.stolp(data, int.Parse(deltaTextBox.Text), int.Parse(l0TextBox.Text)).ForEach(i =>
                {
                    ValuesC.Add(new ObservablePoint(i.Attributes[0], i.Attributes[1]));
                });

                List <Data> standarts = new List <Data>();
                //standarts.AddRange(stolp.findStandard(data));
                standarts.AddRange(stolp.findStandard(stolp.emissionСutOff(data, int.Parse(deltaTextBox.Text))));
                standarts.ForEach(i =>
                {
                    ValuesD.Add(new ObservablePoint(i.Attributes[0], i.Attributes[1]));
                });
            }
            else
            {
                MessageBox.Show("Сперва Выберите Файл c обучающей выборкой");
            }

            /*data.ForEach(i =>
             * {
             *  switch (i.ObjClass)
             *  {
             *      case 0: ValuesA.Add(new ObservablePoint(i.Attributes[0], i.Attributes[1])); break;
             *      case 1: ValuesB.Add(new ObservablePoint(i.Attributes[0], i.Attributes[1])); break;
             *  }
             * });
             *
             */
        }
Beispiel #3
0
        public void CleanOnClick(object sender, RoutedEventArgs e)
        {
            Kars.MainWindow.List_dz_foarm.Clear();
            Kars.MainWindow.List_kars_x.Clear();
            Kars.MainWindow.List_kars_y.Clear();
            ValuesB.Clear();
            ValuesE.Clear();
            Value_Centr.Clear();
            Listbox_dz_x.Items.Clear();
            Listbox_dz.Items.Clear();
            Listbox_dz_y.Items.Clear();
            Value_Kars.Clear();
            List_XY.Clear();
            count       = 0;
            DataContext = this;

            ListBoxLog.Items.Add("Очистка!");
        }