Esempio n. 1
0
        public void Classify()
        {
            Classifier classifier = new Classifier();

            TestDataManager.BuildTestDatas(WordDictionary);
            classifier.CalculateProbabilities(NumClasses, classNames, ClassHits.ToArray());
            for (int i = 0; i < TestDataManager.TestDatas.Count; i++)
            {
                classifier.Classify(TestDataManager.TestDatas[i], classNames);
            }

            classifier.PrintErrorRate();
        }
Esempio n. 2
0
 public void Setup()
 {
     if (ReBuildDictionary)
     {
         WordDictionary = WordDictionaryManager.BuildDictionary(classNames);
         NumClasses     = NumClassesManager.BuildNumClasses(classNames);
         foreach (string item in classNames)
         {
             ClassHits.Add(ClassHitsManager.BuildClassHits(item, WordDictionary));
         }
     }
     else
     {
         WordDictionary = WordDictionaryManager.LoadDictionary();
         NumClasses     = NumClassesManager.LoadNumClasses();
         foreach (string item in classNames)
         {
             ClassHits.Add(ClassHitsManager.LoadClassHits(item));
         }
     }
 }