BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 REGRESSION
27 #define REGRESSION
28 
29 #ifndef MODELH
30 #include <BALL/QSAR/Model.h>
31 #endif
32 
33 #ifndef REGVALIDATION
35 #endif
36 
37 #include <fstream>
38 
39 namespace BALL
40 {
41  namespace QSAR
42  {
44  {
45  public:
51  RegressionModel(const QSARData& q);
52 
53  ~RegressionModel();
54 
55  virtual void operator=(const RegressionModel& m);
57 
58 
64 
66  const BALL::Matrix<double>* getTrainingResult() const;
67 
68  virtual void saveToFile(string filename);
69 
70  virtual void readFromFile(string filename);
71 
72  void show();
74 
75 
76  protected:
89 
90  // RowVector holding the regression constants (one value for each feature)
93 
94 
98  virtual void calculateOffsets() = 0;
99 
100  void readDescriptorInformationFromFile(std::ifstream& in, int no_descriptors, bool transformation, int no_coefficients);
101 
102  void saveDescriptorInformationToFile(std::ofstream& out);
104 
105 
106  friend class RegressionValidation;
107 
108  };
109  }
110 }
111 
112 #endif // REGRESSION