예제 #1
0
 public override PCFuzzySystem TuneUpFuzzySystem(PCFuzzySystem Classify, ILearnAlgorithmConf conf)
 {
     result = Classify;
     Init(conf);
     switch (voteType)
     {
     case 0:
     {
         int i = 0;
         List <KnowlegeBasePCRules> populsOfOneAlgorithm = new List <KnowlegeBasePCRules>();
         for (int p_i = 0; p_i < populInFirstAlg; p_i++)
         {
             populsOfOneAlgorithm.Add(result.RulesDatabaseSet[i]);
             i++;
         }
         Console.WriteLine("Bagging First: ");
         Console.WriteLine("Обуч: " + Math.Round(result.ClassifyLearnSamplesBagging(populsOfOneAlgorithm), 2));
         Console.WriteLine("Тест: " + Math.Round(result.ClassifyTestSamplesBagging(populsOfOneAlgorithm), 2));
         populsOfOneAlgorithm.Clear();
         if (populInSecondAlg > 0)
         {
             for (int p_i = 0; p_i < populInSecondAlg; p_i++)
             {
                 populsOfOneAlgorithm.Add(result.RulesDatabaseSet[i]);
                 i++;
             }
             Console.WriteLine("Bagging Second: ");
             Console.WriteLine("Обуч: " + Math.Round(result.ClassifyLearnSamplesBagging(populsOfOneAlgorithm), 2));
             Console.WriteLine("Тест: " + Math.Round(result.ClassifyTestSamplesBagging(populsOfOneAlgorithm), 2));
             populsOfOneAlgorithm.Clear();
             if (populInThirdAlg > 0)
             {
                 for (int p_i = 0; p_i < populInThirdAlg; p_i++)
                 {
                     populsOfOneAlgorithm.Add(result.RulesDatabaseSet[i]);
                     i++;
                 }
                 Console.WriteLine("Bagging Third: ");
                 Console.WriteLine("Обуч: " + Math.Round(result.ClassifyLearnSamplesBagging(populsOfOneAlgorithm), 2));
                 Console.WriteLine("Тест: " + Math.Round(result.ClassifyTestSamplesBagging(populsOfOneAlgorithm), 2));
                 populsOfOneAlgorithm.Clear();
             }
             Console.WriteLine("Mixed Bagging: ");
             Console.WriteLine("Обуч: " + Math.Round(result.ClassifyLearnSamplesBagging(result.RulesDatabaseSet), 2));
             Console.WriteLine("Тест: " + Math.Round(result.ClassifyTestSamplesBagging(result.RulesDatabaseSet), 2));
         }
         break;
     }
     }
     return(result);
 }