Example #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;
                }
            }
        }
Example #2
0
        private void DisplayResults(TrainingJob job)
        {
            job.Predict();

            var validator = new Validator(job);

            PropulatePredictionsListBox(validator.TestY, validator.PredY, validator.PercentualError.Values);
            PopulateResumeGroupBox(validator.PercentualError);

            // change tab to display results.
            tabControl.SelectedTab = tabControl.TabPages[1];
        }
Example #3
0
        public Validator(TrainingJob job)
        {
            this.job = job;

            TestX = job.TestData.AsArray(job.Features);
            TestX = job.Scaler.Transform(TestX);

            TestY = MathUtils.Flatten(job.TestData.AsArray(job.Target));
            PredY = MathUtils.Flatten(job.Predictions);

            PerformCalculations();
        }
Example #4
0
 public ANOVA(TrainingJob job)
 {
     this.job = job;
     Calculate();
 }