Exemplo n.º 1
0
 public MainForm()
 {
     InitializeComponent();
     trainTable = File_Reader.GetTrainTable(Directory.GetCurrentDirectory() + @"\trainTable.txt");
     classifier = new Classifier();
     classifier.Fit(trainTable);
 }
Exemplo n.º 2
0
        private void testProcess()
        {
            List <string[]> quests = File_Reader.GetQuestions(Directory.GetCurrentDirectory() + @"\testQuestions.txt");

            panelMain.Controls.Clear();
            List <Label> labels = GetTestLabels();

            int[] testResult = new int[5];
            int   i          = 0;

            for (int j = 0; j < 4; j++)
            {
                labels[j].Text = quests[i][j];
            }
            for (int j = 0; j < 4; j++)
            {
                labels[j].Click += delegate(object sender, EventArgs e)
                {
                    testResult[i] = int.Parse((sender as Label).Name);
                    i++;
                    if (i > 4)
                    {
                        testFinish(testResult);
                    }
                    else
                    {
                        labelsUpdate(ref labels, quests, i);
                    }
                };
            }

            foreach (Label lab in labels)
            {
                panelMain.Controls.Add(lab);
            }
        }