-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (42 loc) · 1.17 KB
/
main.cpp
File metadata and controls
53 lines (42 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// main.cpp
// lab2
//
// Created by Анастасия Попова on 04.11.16.
// Copyright © 2016 Анастасия Попова. All rights reserved.
//
#include <iostream>
#include "classifier.hpp"
using namespace std;
int main() {
Classifier my;
vector<pair<double, double>> myTest;
myTest.push_back(make_pair(190, 90));
myTest.push_back(make_pair(185, 86));
myTest.push_back(make_pair(165, 46));
myTest.push_back(make_pair(164, 49));
myTest.push_back(make_pair(179, 76));
myTest.push_back(make_pair(155, 42));
vector<d>test1;
ifstream F;
F.open("/Users/anastasiapopova/Desktop/YANDEX/lab2_Bayes/lab2/train_test_set");
my.train(F, barChart);
vector<int>ans = my.classify(myTest);
for (int i=0; i<ans.size(); i++){
cout<<ans[i]<<" ";
}
cout<<endl;
my.train(F, normalDistribution);
ans = my.classify(myTest);
for (int i=0; i<ans.size(); i++){
cout<<ans[i]<<" ";
}
cout<<endl;
my.train(F, parzanRozenblatt);
ans = my.classify(myTest);
for (int i=0; i<ans.size(); i++){
cout<<ans[i]<<" ";
}
cout<<endl;
return 0;
}