BALL  1.4.79
regressionModel.h
Go to the documentation of this file.
1 /* regressionModel.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 BALL_QSAR_REGRESSIONMODEL_H
27 #define BALL_QSAR_REGRESSIONMODEL_H
28 
29 #include <BALL/QSAR/Model.h>
31 
32 #include <fstream>
33 
34 namespace BALL
35 {
36  class Rescoring;
37 
38  namespace QSAR
39  {
41  {
42  public:
48  RegressionModel(const QSARData& q);
49 
50  ~RegressionModel();
51 
52  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
53 
54  virtual void operator=(const RegressionModel& m);
56 
57 
63 
65  const Eigen::MatrixXd* getTrainingResult() const;
66 
67  virtual void saveToFile(string filename);
68 
69  virtual void readFromFile(string filename);
70 
71  void show();
73 
74 
75  protected:
87  Eigen::MatrixXd training_result_;
88 
89  // RowVector holding the regression constants (one value for each feature)
90  Eigen::RowVectorXd offsets_;
92 
93 
97  virtual void calculateOffsets() = 0;
98 
99  void readDescriptorInformationFromFile(std::ifstream& in, int no_descriptors, bool transformation, int no_coefficients);
100 
101  void saveDescriptorInformationToFile(std::ofstream& out);
103 
104  friend class RegressionValidation;
105  friend class Rescoring;
106 
107  };
108  }
109 }
110 
111 #endif // BALL_QSAR_REGRESSIONMODEL_H
Eigen::RowVectorXd offsets_
Eigen::MatrixXd training_result_
RegressionValidation * validation
-*- Mode: C++; tab-width: 2; -*-
Definition: constants.h:12
#define BALL_EXPORT
Definition: COMMON/global.h:50