Пример #1
0
        private void trainModelButton_Click(object sender, EventArgs e)
        {
            var model = (Model)modelsListBox.SelectedItem;

            if (model == null)
            {
                MessageBox.Show("Debe seleccionar un modelo de la lista", "Error", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            var features = ExtractFeaturesFromCheckBoxList();

            if (features.Length == 0)
            {
                MessageBox.Show("Debe seleccionar las features de entrenamiento", "Error", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            var target = (string)targetComboBoxList.SelectedItem;

            if (target == null)
            {
                MessageBox.Show("Debe seleccionar el target de entrenamiento", "Error", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            var trainingPercentage = (int)trainingPercentageNumericUpDown.Value;

            var job = new TrainingJob
            {
                Model              = model,
                Features           = features,
                Target             = target,
                DataHandler        = dataHandler,
                TrainingPercentage = trainingPercentage
            };

            using (var m = new TrainingDialog())
            {
                m.Job = job;

                switch (m.ShowDialog())
                {
                case DialogResult.OK:
                    DisplayResults(job);
                    break;

                case DialogResult.Cancel:
                    MessageBox.Show("Entrenamiento cancelado.");
                    break;
                }
            }
        }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            var m = new TrainingDialog();

            m.Show();
        }