BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
kernelModel.h
Go to the documentation of this file.
1 /* kernelModel.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 KMODEL
27 #define KMODEL
28 
29 #ifndef NLMODEL
31 #endif
32 
33 #ifndef LMODEL
34 #include <BALL/QSAR/linearModel.h>
35 #endif
36 
37 #ifndef KERNEL
38 #include <BALL/QSAR/kernel.h>
39 #endif
40 
41 
42 
43 namespace BALL
44 {
45  namespace QSAR
46  {
48  {
49  public:
53  KernelModel(const QSARData& q, int k_type, double p1, double p2);
54 
55  KernelModel(const QSARData& q, String f, String g);
56 
57  KernelModel(const QSARData& q, Eigen::VectorXd& w);
58 
59  KernelModel(const QSARData& q, const LinearModel& lm, int column);
60 
61  ~KernelModel();
62 
63  virtual void saveToFile(string filename);
64 
65  virtual void readFromFile(string filename);
66 
67  virtual Eigen::VectorXd predict(const vector<double>& substance, bool transform);
68 
69  void operator=(const Model& m);
70 
71  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
73 
79 
80 
81  protected:
82 
87  Eigen::MatrixXd K_;
88 
90  //Matrix B;
92 
93 
97  void calculateOffsets();
98 
99  void readKernelParametersFromFile(std::ifstream& in);
100  void saveKernelParametersToFile(std::ofstream& out);
101  void saveTrainingResult(std::ofstream& out);
102  void readTrainingResult(std::ifstream& input, int no_substances, int no_y);
103 
104  friend class RegressionValidation;
105  //}@
106 
107 
108  };
109  }
110 }
111 
112 
113 #endif // NLMODEL
Eigen::MatrixXd K_
Definition: kernelModel.h:87
#define BALL_EXPORT
Definition: COMMON/global.h:50