BALL 1.5.0
Loading...
Searching...
No Matches
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
15#endif
16
17#ifndef STATISTICS
19#endif
20
21namespace BALL
22{
23 namespace QSAR
24 {
25
28 {
29 public:
33 NBModel(const QSARData& q);
34
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
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
void saveToFile(string filename)
void readFromFile(string filename)
void setParameters(vector< double > &v)
Eigen::VectorXd predict(const vector< double > &substance, bool transform=1)
NBModel(const QSARData &q)
vector< double > calculateProbabilities(int activitiy_index, int feature_index, double feature_value)
vector< double > getParameters() const
#define BALL_EXPORT