Exemple #1
0
        public static void Run()
        {
            //const string path = @"F:\thoughts\";
            while (true)
            {
                Console.WriteLine("Write path to file(s):");
                var path = Console.ReadLine();
                Console.WriteLine("Where to save results?");
                var savePath = Console.ReadLine();

                if (path != null)
                {
                    var fileReader           = new FileReader(path);
                    var documents            = fileReader.PerformRead();
                    var clusterableDocuments = new MyDocumentToClusterableEntityMapper().MapAllData(documents);
                    var kMeansDatas          = new ClusterableEntityToKMeansEntityMapper().MapAllData(clusterableDocuments);

                    var clusterer = new Clusterer(7);
                    clusterer.Cluster(kMeansDatas, null);

                    var results = new ClusteredDataResultWriter().WriteResults(kMeansDatas);
                    if (savePath != null)
                    {
                        File.WriteAllText(savePath, results);
                    }
                }

                Console.WriteLine($"Amount of exceptions while reading: {exceptionsCount}");
                Console.Read();
            }
        }
Exemple #2
0
        private void initialize_Click(object sender, EventArgs e)
        {
            Task.Run(() =>
            {
                var handedData = initializer.InitializeData();
                var mapper     = new ClusterableEntityToKMeansEntityMapper();
                data           = mapper.MapAllData(handedData);
                changeDetector.RegisterInitialData(data);

                var watch = new Stopwatch();
                watch.Start();
                //DrawData();
                watch.Stop();
                Debug.WriteLine(watch.ElapsedMilliseconds);
            });
        }