-
Notifications
You must be signed in to change notification settings - Fork 1
/
ml.h
42 lines (35 loc) · 857 Bytes
/
ml.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
#pragma once
/*
This is the head file for machine learning algorithm implemented by
Matrix class defined in mymatrix.h and Matlab class defined in matlab.h.
The design of this class encapsulates as much algorithm details as possible
for convenient APIs.
*/
#include "mymatrix.h"
#include "matlab.h"
#include "specialmat.h"
#include "exception.h"
namespace ml {
class linearClassifier;
class ligisticClassifier;
class neuralNetwork;
};
class ml::ligisticClassifier {
};
class ml::linearClassifier {
public:
/*
Constructors: specify the number of iteration
*/
linearClassifier(int);
void train(const Matrix&, const Matrix&);
Matrix predict(const Matrix&);
double loss_func(const Matrix&, const Matrix&);
private:
Matrix weights;
double bias;
// should inheritate
void _matrix_check(const Matrix&);
};
class ml::neuralNetwork {
};