private void ApplyButton_Click(object sender, EventArgs e)
        {
            String output;

            if (Iterative_rb.Checked)
            {
                /*F1_meassure f1_meassure = new F1_meassure(ClusterInfo, ClassInfo);
                 * output = "F1-мера: " + f1_meassure.F1() + "\r\n";
                 * Rand_Jaccard_FM rand_jaccard_fm = new Rand_Jaccard_FM(ClusterInfo, ClassInfo);
                 * output += "Индекс Rand: " + rand_jaccard_fm.Rand_index() + "\r\n";
                 * output += "Индекс Jaccard: " + rand_jaccard_fm.Jaccard_index() + "\r\n";
                 * output += "Индекс FM: " + rand_jaccard_fm.FM_index() + "\r\n";*/
                AdjustedMutualInformation mutual_information = new AdjustedMutualInformation(ClassInfo, ClusterInfo);
                output = "Взаимная информация: " + mutual_information.Compute() + "\r\n";
            }
            else if (Density_rb.Checked)
            {
                Density_F1_meassure f1_meassure = new Density_F1_meassure(ClusterInfo, ClassInfo);
                output = "F1-мера: " + f1_meassure.F1() + "\r\n";
                Density_Rand_Jaccard_FM rand_jaccard_fm = new Density_Rand_Jaccard_FM(ClusterInfo, ClassInfo);
                output += "Индекс Rand: " + rand_jaccard_fm.Rand_index() + "\r\n";
                output += "Индекс Jaccard: " + rand_jaccard_fm.Jaccard_index() + "\r\n";
                output += "Индекс FM: " + rand_jaccard_fm.FM_index() + "\r\n";
            }
            else if (Hierarchical_rb.Checked)
            {
                Hierarchical_F1_meassure f1_meassure = new Hierarchical_F1_meassure(dendrogram, ClassInfo);
                output = "F1-мера: " + f1_meassure.F1() + "\r\n";
                Hierarchical_Rand_Jaccard_FM rand_jaccard_fm = new Hierarchical_Rand_Jaccard_FM(dendrogram, ClassInfo);
                output += "Индекс Rand: " + rand_jaccard_fm.Rand_index() + "\r\n";
                output += "Индекс Jaccard: " + rand_jaccard_fm.Jaccard_index() + "\r\n";
                output += "Индекс FM: " + rand_jaccard_fm.FM_index() + "\r\n";
                HierarchicalAdjustedMutualInformation mutual_information = new HierarchicalAdjustedMutualInformation(dendrogram, ClassInfo);
                output += "Взаимная информация: " + mutual_information.Compute() + "\r\n";
            }
            else
            {
                bool OnlyF1Measuure = false;
                if (ClusterInfo == null)
                {
                    CreateClusterInfoFromDendrogram();
                    OnlyF1Measuure = true;
                }
                Fuzzy_F1_meassure f1_meassure = new Fuzzy_F1_meassure(ClusterInfo, ClassInfo);
                output = "F1-мера: " + f1_meassure.F1() + "\r\n";
                if (!OnlyF1Measuure)
                {
                    Fuzzy_Rand_Jaccard_FM rand_jaccard_fm = new Fuzzy_Rand_Jaccard_FM(ClusterInfo, ClassInfo);
                    output += "Индекс Rand: " + rand_jaccard_fm.Rand_index() + "\r\n";
                    output += "Индекс Jaccard: " + rand_jaccard_fm.Jaccard_index() + "\r\n";
                    output += "Индекс FM: " + rand_jaccard_fm.FM_index() + "\r\n";
                }
            }
            MessageBox.Show(output);
        }
Ejemplo n.º 2
0
        private void QualityGradeButton_Click(object sender, EventArgs e)
        {
            String output;

            if (isHierarchicalClustering)
            {
                ArrayList ClassInfo = CreateClassInfo();
                Hierarchical_F1_meassure f1_meassure = new Hierarchical_F1_meassure(dendrogram, ClassInfo);
                output = "F1-мера: " + f1_meassure.F1() + "\r\n";
                Hierarchical_Rand_Jaccard_FM rand_jaccard_fm = new Hierarchical_Rand_Jaccard_FM(dendrogram, ClassInfo);
                output += "Индекс Rand: " + rand_jaccard_fm.Rand_index() + "\r\n";
                output += "Индекс Jaccard: " + rand_jaccard_fm.Jaccard_index() + "\r\n";
                output += "Индекс FM: " + rand_jaccard_fm.FM_index() + "\r\n";
                HierarchicalAdjustedMutualInformation mutual_information = new HierarchicalAdjustedMutualInformation(dendrogram, ClassInfo);
                output += "Взаимная информация: " + mutual_information.Compute() + "\r\n";
            }
            else if (isFuzzyClustering)
            {
                ArrayList         ClusterInfo = CreateClassInfo();
                ArrayList         ClassInfo   = CreateClassInfo();
                Fuzzy_F1_meassure f1_meassure = new Fuzzy_F1_meassure(ClusterInfo, ClassInfo);
                output = "F1-мера: " + f1_meassure.F1() + "\r\n";
                Fuzzy_Rand_Jaccard_FM rand_jaccard_fm = new Fuzzy_Rand_Jaccard_FM(ClusterInfo, ClassInfo);
                output += "Индекс Rand: " + rand_jaccard_fm.Rand_index() + "\r\n";
                output += "Индекс Jaccard: " + rand_jaccard_fm.Jaccard_index() + "\r\n";
                output += "Индекс FM: " + rand_jaccard_fm.FM_index() + "\r\n";
                FuzzyAdjustedMutualInformation mutual_information = new FuzzyAdjustedMutualInformation(ClusterInfo, ClassInfo);
                output += "Взаимная информация: " + mutual_information.Compute() + "\r\n";
            }
            else
            {
                ArrayList           ClusterInfo = CreateClusterInfo();
                ArrayList           ClassInfo   = CreateClassInfo();
                Density_F1_meassure f1_meassure = new Density_F1_meassure(ClusterInfo, ClassInfo);
                output = "F1-мера: " + f1_meassure.F1() + "\r\n";
                Density_Rand_Jaccard_FM rand_jaccard_fm = new Density_Rand_Jaccard_FM(ClusterInfo, ClassInfo);
                output += "Индекс Rand: " + rand_jaccard_fm.Rand_index() + "\r\n";
                output += "Индекс Jaccard: " + rand_jaccard_fm.Jaccard_index() + "\r\n";
                output += "Индекс FM: " + rand_jaccard_fm.FM_index() + "\r\n";
                AdjustedMutualInformation mutual_information = new AdjustedMutualInformation(ClusterInfo, ClassInfo);
                output += "Взаимная информация: " + mutual_information.Compute() + "\r\n";
            }
            MessageBox.Show(output);
        }