forked from makkorjamal/PLSduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPLSduino.h
More file actions
52 lines (45 loc) · 1013 Bytes
/
Copy pathPLSduino.h
File metadata and controls
52 lines (45 loc) · 1013 Bytes
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
/*
PLS.h - Library for flashing Morse code.
Created by Jamal Makkor contact@makkor.de
Released into the public domain.
*/
#ifndef PLS_h
#define PLS_h
#include "Arduino.h"
#include <ArduinoEigenDense.h>
using Eigen::MatrixXf;
using Eigen::VectorXf;
class PLS
{
private:
MatrixXf B, mean0X, mean0Y;
inline void display(
const char *name,
const MatrixXf &value );
bool isModelShapeValid(
const MatrixXf &B,
const MatrixXf &meanX,
const MatrixXf &meanY ) const;
void printModelShapeError(
const MatrixXf &B,
const MatrixXf &meanX,
const MatrixXf &meanY ) const;
public:
PLS( );
PLS(int brate );
PLS( const MatrixXf &B, const MatrixXf &meanX, const MatrixXf &meanY );
~PLS();
bool setModel(
const MatrixXf &B,
const MatrixXf &meanX,
const MatrixXf &meanY );
void train(
const MatrixXf &Xdata,
const MatrixXf &Ydata,
float epsilon = 0.0001 );
MatrixXf predict(
const MatrixXf &v ) const;
MatrixXf pseudoMat(
MatrixXf P);
};
#endif