BALL  1.4.79
snBModel.h
Go to the documentation of this file.
1 /* snBModel.h
2  *
3  * Copyright (C) 2009 Marcel Schumann
4  *
5  * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
6  * Construction and Validation.
7  * QuEasy is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or (at
10  * your option) any later version.
11  *
12  * QuEasy is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 // -*- Mode: C++; tab-width: 2; -*-
22 // vi: set ts=2:
23 //
24 //
25 
26 #ifndef SNBMODEL
27 #define SNBMODEL
28 
29 #ifndef BALL_QSAR_COMMON_H
30  #include <BALL/QSAR/common.h>
31 #endif
32 
33 #ifndef STATISTICS
34 #include <BALL/QSAR/statistics.h>
35 #endif
36 
37 #ifndef BAYESMODEL
38 #include <BALL/QSAR/bayesModel.h>
39 #endif
40 
41 
42 namespace BALL{
43  namespace QSAR {
44 
47  {
48  public:
52  SNBModel(const QSARData& q);
53 
54  ~SNBModel();
56 
57 
61  void train();
62 
63  Eigen::VectorXd predict(const vector<double>& substance, bool transform=1);
64 
65  vector<double> getParameters() const;
66 
67  void setParameters(vector<double>& v);
68 
69  void saveToFile(string filename);
70 
71  bool isTrained();
72 
73  void readFromFile(string filename);
74 
77  vector<double> calculateProbabilities(int activitiy_index, int feature_index, double feature_value);
78 
79  int getNoResponseVariables();
81 
82 
83  private:
88  MatrixVector mean_;
89 
91  MatrixVector stddev_;
92 
93  static const double sqrt2Pi_;
94 
95 
96 
98  };
99  }
100 }
101 
102 #endif //SNBMODEL
std::vector< Eigen::MatrixXd, Eigen::aligned_allocator< Eigen::MatrixXd > > MatrixVector
Definition: QSAR/common.h:10
-*- Mode: C++; tab-width: 2; -*-
Definition: constants.h:12
#define BALL_EXPORT
Definition: COMMON/global.h:50