Projekt

Obecné

Profil

Stáhnout (1.86 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 36c0667f Eliška Mourycová
            //p.Parse();
16 d2d1c86a Eliška Mourycová
17
18
            // test scenario - data download:
19 36c0667f Eliška Mourycová
            //DataDownloader dd = new DataDownloader();
20
            //         List<string> savedFiles = new List<string>();
21
            //         savedFiles.AddRange(dd.DownloadData(DataType.JIS, DataFormat.CSV, 2017, 2021, 0, 13));
22
            //         savedFiles.AddRange(dd.DownloadData(DataType.POCASI, DataFormat.CSV, 2017, 2021, 0, 13));
23
            //         savedFiles.AddRange(dd.DownloadData(DataType.STROJE, DataFormat.CSV, 2017, 2021, 0, 13));
24
25
26
            //         Console.WriteLine("Saved files: ");
27
            //         foreach(string s in savedFiles)
28
            //{
29
            //             Console.WriteLine(s);
30
            //}
31 d2d1c86a Eliška Mourycová
32 36c0667f Eliška Mourycová
33
34
            // test - connection:
35 1434de93 Eliška Mourycová
            AsynchronousSocketListener asl = new AsynchronousSocketListener();
36
            asl.StartListening();
37 36c0667f Eliška Mourycová
           
38 3811845f Alex Konig
39 9fc5fa93 Roman Kalivoda
            NaiveBayesClassifier naiveBayesClassifier = new NaiveBayesClassifier();
40
            IEnumerable<ModelInput> modelInput = naiveBayesClassifier.ExtractModelInput(p.weatherList, p.jisList);
41
            naiveBayesClassifier.Fit(modelInput);
42 66c3e0df Roman Kalivoda
            List<ModelInput> dataList = new List<ModelInput>()
43 9fc5fa93 Roman Kalivoda
            {
44 66c3e0df Roman Kalivoda
                new ModelInput()
45
                {
46
                    Temp = -40,
47
                }
48 9fc5fa93 Roman Kalivoda
            };
49
            var result = naiveBayesClassifier.Predict(dataList);
50
51 66c3e0df Roman Kalivoda
            Console.WriteLine($"Predictions: ");
52
            foreach(var item in result)
53
            {
54
                Console.WriteLine(item.ToString());
55
            }
56 9fc5fa93 Roman Kalivoda
57 3811845f Alex Konig
            Console.ReadLine();
58
        }
59
    }
60
}