-
Notifications
You must be signed in to change notification settings - Fork 0
/
knearest.h
37 lines (26 loc) · 749 Bytes
/
knearest.h
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
//
// knearest.h
// VoterMLA
//
// Created by MD Shihabul Kabir on 12/5/16.
// Copyright © 2016 MD Shihabul Kabir. All rights reserved.
//
#ifndef knearest_h
#define knearest_h
#include "county.h"
#include <vector>
//K-Nearest Neighbor Namespace
namespace KnearestAlgo {
//Data structure to process knn algorithm
class Knearest{
private:
//Member to store training set
std::vector<CountyStruct::County>trainingSet;
public:
//constructor
Knearest(std::vector<CountyStruct::County>&train);
//method to predict whether a county voted a democrat or republican
int predict(CountyStruct::County& aCounty);
};
}
#endif /* knearest_h */