Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
 public DetectorWindow()
 {
     InitializeComponent();
     weightsFileLoaded = IOoperations.ReadWeightsFrom(Config.weightsFilePath);
     RefreshDebug();
     lFirstPerson.Content    = "";
     lSecondPerson.Content   = "";
     lDesc5.Visibility       = Visibility.Collapsed;
     listBoxNames.Visibility = Visibility.Collapsed;
     IOoperations.AIdataFromJSON(Config.aiDataFilePath);
 }
Exemplo n.º 3
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            try
            {
                string actualRightPerson = listBoxNames.SelectedItem.ToString();
                if (actualRightPerson == null)
                {
                    return;
                }

                IOoperations.AIdataToJSON(actualRightPerson);
            }
            catch { }
        }
Exemplo n.º 4
0
        private void btnLoadData_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new Ookii.Dialogs.Wpf.VistaFolderBrowserDialog();

            dialog.SelectedPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            string path;

            if (dialog.ShowDialog(this).GetValueOrDefault())
            {
                path = dialog.SelectedPath;
                IOoperations.ReadFilesFrom(path);
                RefreshDebug();
            }
            else
            {
                return;
            }
        }
Exemplo n.º 5
0
 public UserEndScreen()
 {
     InitializeComponent();
     IOoperations.SerializeToJson();
 }