1
|
using Connection;
|
2
|
using ServerApp.Parser.Parsers;
|
3
|
using ServerApp.Predictor;
|
4
|
using System;
|
5
|
using System.Collections.Generic;
|
6
|
|
7
|
namespace ServerApp
|
8
|
{
|
9
|
class Program
|
10
|
{
|
11
|
static void Main(string[] args)
|
12
|
{
|
13
|
DataParser p = new DataParser("data/");
|
14
|
|
15
|
//p.Parse();
|
16
|
|
17
|
|
18
|
// test scenario - data download:
|
19
|
//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
|
|
32
|
|
33
|
|
34
|
// test - connection:
|
35
|
AsynchronousSocketListener asl = new AsynchronousSocketListener();
|
36
|
asl.StartListening();
|
37
|
|
38
|
|
39
|
NaiveBayesClassifier naiveBayesClassifier = new NaiveBayesClassifier();
|
40
|
IEnumerable<ModelInput> modelInput = naiveBayesClassifier.ExtractModelInput(p.weatherList, p.jisList);
|
41
|
naiveBayesClassifier.Fit(modelInput);
|
42
|
List<ModelInput> dataList = new List<ModelInput>()
|
43
|
{
|
44
|
new ModelInput()
|
45
|
{
|
46
|
Temp = -40,
|
47
|
}
|
48
|
};
|
49
|
var result = naiveBayesClassifier.Predict(dataList);
|
50
|
|
51
|
Console.WriteLine($"Predictions: ");
|
52
|
foreach(var item in result)
|
53
|
{
|
54
|
Console.WriteLine(item.ToString());
|
55
|
}
|
56
|
|
57
|
Console.ReadLine();
|
58
|
}
|
59
|
}
|
60
|
}
|