CEBL  2.1
LDA.hpp
Go to the documentation of this file.
1 /*
2 * CEBL : CSU EEG Brain-Computer Interface Lab
3 *
4 * Author: Jeshua Bratman - jeshuabratman@gmail.com
5 *
6 * This file is part of CEBL.
7 *
8 * CEBL is free software; you can redistribute it and/or modify it.
9 * We only ask that if you use our code that you cite the source in
10 * your project or publication.
11 *
12 * EEG Group (www.cs.colostate.edu/eeg)
13 * Department of Computer Science
14 * Colorado State University
15 *
16 */
17 
18 #ifndef LDA_H
19 #define LDA_H
20 
21 #include "../model/Classifier.hpp"
22 
23 namespace CEBL
24 {
25  class LDA : public Classifier
26  {
27  private:
28  ublas::vector<double> priors;
29  ublas::matrix<double> means;
30  ublas::matrix<double> covariance;
31  ublas::matrix<double> covarianceInv;
32  ublas::vector<int> classes;
33  ublas::matrix<double> weights;
34  ublas::vector<double> bias;
35 
36 
37 
38 
39  public:
40  LDA() { plugin_name = "LDA"; }
41 
43  void train(const EEGTrainingData &);
44 
46  ublas::vector<int> use(const ublas::matrix<double> &);
47 
49  std::map<std::string, CEBL::Param> getParamsList();
50  void setParamsList( std::map<std::string, CEBL::Param> &);
51 
52  //saving and loading
53  map<string, SerializedObject> save() const;
54  void load(map<string, SerializedObject> objects);
55 
56  };
57 }
58 #endif