-
Notifications
You must be signed in to change notification settings - Fork 1
/
Predict.hpp
52 lines (35 loc) · 1.15 KB
/
Predict.hpp
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
/**
* @brief A header for the predict class which contains logistic regression training and prediction methods
* @author Gurkiran Tatla
* @author Jake Schindler
* @author Justine Kim
* @author Paul Salvatore
* @author Timal Peramune
*/
#ifndef PREDICT_H
#define PREDICT_H
#include <iostream>
#include <armadillo>
#include <stdlib.h>
#define LAMBDA 1
#define THRESHOLD 0.6
#define CERTAINTY_THRESHOLD 0.7
#define DEGREE 5
#define MAPPED_NUM 21
class Predict {
public:
Predict();
virtual ~Predict();
static arma::mat trainAndPredict(int lightId, int machineLearning);
static int checkConfidence(int lightId);
private:
static arma::mat mapFeature(arma::mat X1, arma::mat X2);
static arma::mat sigmoid(arma::mat *theta, arma::mat *X, unsigned long m);
static arma::mat predict(arma::mat *theta, arma::mat *X);
static arma::mat normalEquation(arma::mat *X, arma::mat *y);
static arma::mat generateLightMatrix(int lightId);
static arma::mat generateWeekOfX();
static arma::mat predictByFrequency(arma::mat *data);
static double fscore(arma::mat *y_predicted, arma::mat *y_test);
};
#endif