BALL  1.5.0
nBModel.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 //
5 
6 #ifndef NBMODEL
7 #define NBMODEL
8 
9 #ifndef BALL_QSAR_COMMON_H
10 #include <BALL/QSAR/common.h>
11 #endif
12 
13 #ifndef BAYESMODEL
14 #include <BALL/QSAR/bayesModel.h>
15 #endif
16 
17 #ifndef STATISTICS
18 #include <BALL/QSAR/statistics.h>
19 #endif
20 
21 namespace BALL
22 {
23  namespace QSAR
24  {
25 
28  {
29  public:
33  NBModel(const QSARData& q);
34 
35  ~NBModel();
36 
37  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
39 
40 
44  void train();
45 
46  Eigen::VectorXd predict(const vector<double>& substance, bool transform=1);
47 
48  void saveToFile(string filename);
49 
50  void readFromFile(string filename);
51 
52  vector<double> getParameters() const;
53 
54  void setParameters(vector<double>& v);
55 
56  bool isTrained();
57 
58  vector<double> calculateProbabilities(int activitiy_index, int feature_index, double feature_value);
59 
60  int getNoResponseVariables();
62 
63 
64  private:
68 
69  unsigned int discretization_steps_;
70 
71 
73  Eigen::MatrixXd min_max_;
74 
77  vector<MatrixVector, Eigen::aligned_allocator<MatrixVector> > probabilities_;
78 
79 
80 
82  };
83  }
84 }
85 
86 #endif //NBMODEL
common.h
BALL
Definition: constants.h:12
BALL::QSAR::QSARData
Definition: QSARData.h:55
BALL::QSAR::BayesModel
Definition: bayesModel.h:18
BALL::QSAR::NBModel
Definition: nBModel.h:27
statistics.h
bayesModel.h
BALL_EXPORT
#define BALL_EXPORT
Definition: COMMON/global.h:50