private void btnDoMagic_Click(object sender, RoutedEventArgs e) { if (Config.allUsersData.Where(p => p.userName == "FINAL").Count() <= 0) { return; } if (Config.USE_NEURAL) { //metoda z użyciem pythona, sieci neuronowych itp IOoperations.AppendAllUserEntries(Config.userEntriesPath); lFirstPerson.Content = IOoperations.GetPythonOutput(); } else { //standardowa metoda przewidywania DataAnalytics.NormalizeData(); SudczakClassifier.Classify(Config.allUsersNormalized, Config.allUsersClassified, "FINAL"); Config.allUsersClassified = Config.allUsersClassified.OrderBy(u => u.probability).Reverse().ToList(); lFirstPerson.Content = Config.allUsersClassified[0].userName + " na " + Math.Round(Config.allUsersClassified[0].probability * 100, 2) + "%"; lSecondPerson.Content = Config.allUsersClassified[1].userName + " na " + Math.Round(Config.allUsersClassified[1].probability * 100, 2) + "%"; } listBoxNames.Items.Clear(); foreach (UserData d in Config.allUsersClassified) { listBoxNames.Items.Add(d); } }
public static bool ReadFilesFrom(string path) { if (!System.IO.Directory.Exists(path)) { return(false); } Config.parsedFiles = 0; Config.unParsedFiles = 0; DirectoryInfo d = new DirectoryInfo(path); foreach (var file in d.GetFiles("*.json")) { DataAnalytics.ParseSingleFile(file); } return(true); }