Пример #1
0
        private void menuItemCross_Click(object sender, RoutedEventArgs e)
        {
            lastOperation = operation.CrossValidate;
            int numberOfSets      = 0;
            NumberOfSetsDialog pd = new NumberOfSetsDialog();

            if (pd.ShowDialog() == true)
            {
                numberOfSets = pd.Answer;
            }
            if (numberOfSets == 0)
            {
                return;
            }
            CrossDataSetsList = new List <DataSetCross>();
            LoadCrossDataSetList(numberOfSets);
            List <k_foldCrossValidation> kList = UseKFoldCrossValidation();

            bestCross = GetBestQualityCross(kList);
            string messageToPrint = PrintQualityInfo(kList, bestCross);

            messageToPrint              += bestCross.ruleSet.PrintRules();
            tbTest.Text                  = messageToPrint;
            tbSizeOfSet.Text             = "Wielkość zbioru uczącego: " + bestCross.dataSet.entireSet.Count();
            tbSizeOfBestTreningSet.Text  = "";
            tbSizeOfBestValidateSet.Text = "";
            tbSizeOfBestTestSet.Text     = "";
            tbSizeOfBestruleSet.Text     = "Ilość reguł: " + bestCross.ruleSet.GetRuleSet().Count();
        }
Пример #2
0
        private string PrintQualityInfo(List <k_foldCrossValidation> kList, k_foldCrossValidation bestCross)
        {
            string message = "Średnia jakość klasyfikatora wyniosła: " + GetAVGQuality(kList) + "\n";

            message += "Najlepsza jakość klasyfikatora wyniosła: " + bestCross.quality.ToString() + "\n";
            List <double> qualities = new List <double>();

            foreach (var k in kList)
            {
                qualities.Add(k.quality);
            }
            message += "Odchylenie standardowe jakości klasyfikatora wyniosło: " + StandardDeviation(qualities) + "\n";
            return(message);
        }