-
Notifications
You must be signed in to change notification settings - Fork 0
/
perceptron.h
48 lines (34 loc) · 983 Bytes
/
perceptron.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
38
39
40
41
42
43
44
45
46
47
48
//
// perceptron.h
// MovieGross
//
//
// Copyright © 2016 ArsenKevinMD. All rights reserved.
//
#ifndef perceptron_h
#define perceptron_h
#include "movie.h"
#include <vector>
//Perceptron Namespace
namespace PerceptronAlgo {
//Data structure to process the perceptron algorithm
class Perceptron{
private:
//Member to manage learning rate
float learningRate;
//Member to store weights
std::vector<float>weights;
//Member to store training data set
std::vector<MovieData::Movie>trainingSet;
public:
//constructor
Perceptron(std::vector<MovieData::Movie>&train,float rate);
//method to train perceptron
void train();
//method to predict overall gross
float predict(MovieData::Movie& aMovie);
//method to update learning rate
void updateLearningRate();
};
}
#endif /* perceptron_h */