private void RadialNeuralLearn() { if (learningDocInfo != null && learningDocInfo.SourceDir != Settings.Default.pathLearningDir) { learningDocInfo = null; } //ładuje listę kategorii DocumentClass.LoadFromFiles(Settings.Default.pathLearningDir, PreprocessingConsts.CategoryFilePattern); //stworzenie słownika dictionary = DictionaryFactory(Settings.Default.pathSummaryFile); //dictionary.LearningData = new List<DocClass.Src.Learning.LearningPair>(); //stworzenie sieci radialNetwork = new RadialNetwork(Settings.Default.numberNeuronsHidden, DocumentClass.CategoriesCount); DocumentList dl = PreprocessingUtility.CreateLearningDocumentList(Settings.Default.pathLearningDir, dictionary, (DocumentRepresentationType)Settings.Default.documentRepresentationType, learningDocInfo); if (radialNetwork.Learn(dl) == false) { radialNetwork = null; dictionary = null; } }
private void button8_Click(object sender, EventArgs e) { DocumentClass.LoadFromFiles(folderTextBox.Text, PreprocessingConsts.CategoryFilePattern); Console.Write(DocumentClass.ToString()); CategoryList categoryList = new CategoryList(folderTextBox.Text, PreprocessingConsts.CategoryFilePattern); MessageBox.Show("Koniec"); }
private void button14_Click(object sender, EventArgs e) { DocumentClass.LoadFromFiles(folderTextBox.Text, PreprocessingConsts.CategoryFilePattern); CtfIdfDictionary dictionary = new CtfIdfDictionary(folderTextBox.Text, folderTextBox.Text + "\\" + PreprocessingConsts.SummaryFileName, 1000); String summaryFilePath = Application.StartupPath + "\\Preprocessing\\" + PreprocessingConsts.SummaryFileName; LearningDocInfo learningDocInfo = new LearningDocInfo(folderTextBox.Text, summaryFilePath); PreprocessingUtility.CreateLearningDocumentList(folderTextBox.Text, dictionary, DocumentRepresentationType.TfIdf, learningDocInfo); MessageBox.Show("Done"); }
private void BayesLearn() { //tworze klasyfikator bayesClassificator = new BayesClassificator(learningWorker); //ładuje listę kategorii DocumentClass.LoadFromFiles(Settings.Default.pathLearningDir, PreprocessingConsts.CategoryFilePattern); //tworze liste kategorii CategoryList categoryList = new CategoryList(Settings.Default.pathLearningDir, PreprocessingConsts.CategoryFilePattern); this.allWordsInBayesCategory = categoryList.AllWordsCount; //nauka if (bayesClassificator.Learn(categoryList) == false) { bayesClassificator = null; this.allWordsInBayesCategory = 0; } }