private void searchBtn_Click(object sender, EventArgs e)
        {
            if (!DataValidation.isDataLoaded(dataLoader, out string dataError))
            {
                MessageBox.Show(dataError);
                return;
            }
            if (!DataValidation.isMetricChosen(comboBox, out string metricError))
            {
                MessageBox.Show(metricError);
                return;
            }
            if ((string)comboBox.SelectedItem == "Minkowski Metric")
            {
                if (!DataValidation.isCorrectP(pBox, out string pError))
                {
                    MessageBox.Show(pError);
                    return;
                }
            }
            p = int.Parse(pBox.Text);
            var data = new List <object>();

            data.Add(Metrics.chooseMetric(comboBox));
            data.Add(comboBox.SelectedItem);
            if (bgw.IsBusy)
            {
                MessageBox.Show("Searching in progress");
                return;
            }
            progBar.Visible     = true;
            resultLabel.Visible = true;
            bgw.RunWorkerAsync(data);
        }
        private void confirm_Click(object sender, EventArgs e)
        {
            Metrics.metric metric;
            DataValidation dataValidation;
            int            k;
            string         userSampleString;
            List <double>  attributesToCheck;
            int?           decision;

            if (!DataValidation.isDataLoaded(dataLoader, out string dataError))
            {
                MessageBox.Show(dataError);
                return;
            }
            dataValidation = new DataValidation(sampleColection, dataLoader, comboBox, kBox, attrBox);
            if (!dataValidation.isValid)
            {
                MessageBox.Show(dataValidation.message);
                return;
            }
            if ((string)comboBox.SelectedItem == "Minkowski Metric")
            {
                if (!DataValidation.isCorrectP(pBox, out string pError))
                {
                    MessageBox.Show(pError);
                    return;
                }
            }
            p = int.Parse(pBox.Text);
            k = int.Parse(kBox.Text);
            userSampleString  = attrBox.Text;
            metric            = Metrics.chooseMetric(comboBox);
            attributesToCheck = Data.rowToList(userSampleString);



            decision            = Algorithm.chooseDecision(attributesToCheck, sampleColection, k, metric, p);
            resultsTextBox.Text = "";
            results.Add("Attributes: " + userSampleString + "\nK: " + k + "\nMetric: " + comboBox.SelectedItem + "\nDecision: " + (decision == null ? "Couldn't solve" : decision.ToString()) + "\n----------\n");
            foreach (string result in results)
            {
                resultsTextBox.Text += result;
            }
        }