Projekt

Obecné

Profil

Stáhnout (1.94 KB) Statistiky
| Větev: | Tag: | Revize:
1 57a75f60 Roman Kalivoda
using Connection;
2
using ServerApp.Parser.Parsers;
3 9fc5fa93 Roman Kalivoda
using ServerApp.Predictor;
4 3811845f Alex Konig
using System;
5
using System.Collections.Generic;
6
7
namespace ServerApp
8
{
9
    class Program
10
    {
11
        static void Main(string[] args)
12
        {
13 98b568bc A-Konig
            DataParser p = new DataParser("data/");
14 3811845f Alex Konig
15 d39750f3 A-Konig
            p.Parse(new DateTime(), new DateTime());
16
17
            Console.ReadLine();
18 d2d1c86a Eliška Mourycová
19
20
            // test scenario - data download:
21 36c0667f Eliška Mourycová
            //DataDownloader dd = new DataDownloader();
22
            //         List<string> savedFiles = new List<string>();
23
            //         savedFiles.AddRange(dd.DownloadData(DataType.JIS, DataFormat.CSV, 2017, 2021, 0, 13));
24
            //         savedFiles.AddRange(dd.DownloadData(DataType.POCASI, DataFormat.CSV, 2017, 2021, 0, 13));
25
            //         savedFiles.AddRange(dd.DownloadData(DataType.STROJE, DataFormat.CSV, 2017, 2021, 0, 13));
26
27
28
            //         Console.WriteLine("Saved files: ");
29
            //         foreach(string s in savedFiles)
30
            //{
31
            //             Console.WriteLine(s);
32
            //}
33 d2d1c86a Eliška Mourycová
34 d39750f3 A-Konig
            /*
35 36c0667f Eliška Mourycová
36
            // test - connection:
37 1434de93 Eliška Mourycová
            AsynchronousSocketListener asl = new AsynchronousSocketListener();
38
            asl.StartListening();
39 36c0667f Eliška Mourycová
           
40 3811845f Alex Konig
41 9fc5fa93 Roman Kalivoda
            NaiveBayesClassifier naiveBayesClassifier = new NaiveBayesClassifier();
42
            IEnumerable<ModelInput> modelInput = naiveBayesClassifier.ExtractModelInput(p.weatherList, p.jisList);
43
            naiveBayesClassifier.Fit(modelInput);
44 66c3e0df Roman Kalivoda
            List<ModelInput> dataList = new List<ModelInput>()
45 9fc5fa93 Roman Kalivoda
            {
46 66c3e0df Roman Kalivoda
                new ModelInput()
47
                {
48
                    Temp = -40,
49
                }
50 9fc5fa93 Roman Kalivoda
            };
51
            var result = naiveBayesClassifier.Predict(dataList);
52
53 66c3e0df Roman Kalivoda
            Console.WriteLine($"Predictions: ");
54
            foreach(var item in result)
55
            {
56
                Console.WriteLine(item.ToString());
57
            }
58 9fc5fa93 Roman Kalivoda
59 3811845f Alex Konig
            Console.ReadLine();
60 d39750f3 A-Konig
            */
61 3811845f Alex Konig
        }
62
    }
63
}