BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
validation.h
Go to the documentation of this file.
1 /* validation.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 VALIDATION
27 #define VALIDATION
28 
29 #ifndef QSARDATA
30 #include <BALL/QSAR/QSARData.h>
31 #endif
32 
33 #include <gsl/gsl_randist.h>
34 #include <gsl/gsl_cdf.h>
35 #include <iterator>
36 
37 
38 namespace BALL
39 {
40  namespace QSAR
41  {
42  class Model;
43 
46  {
47  public:
51  Validation(Model* m);
52 
53  virtual ~Validation();
55 
56 
63  virtual void crossValidation(int k, bool restore=1) = 0;
64 
66  virtual double getCVRes() = 0;
67 
69  virtual double getFitRes() = 0;
70 
72  virtual void setCVRes(double d) = 0;
73 
76  const Matrix<double>& getYRandResults() const;
77 
81  virtual void testInputData(bool transform=0) = 0;
82 
83  virtual void bootstrap(int k, bool restore=1) = 0;
84 
85  virtual const Matrix<double>& yRandomizationTest(int runs, int k) = 0;
86 
90  virtual void selectStat(int s) = 0;
91 
93  int getStat() const;
94 
96  virtual void saveToFile(string filename) const = 0;
97 
99  virtual void readFromFile(string filename) = 0;
101 
102 
103  protected:
104 
109  void setTrainingLine(int train_line, int current_line);
110 
113  void setTestLine(int test_line, int current_line, bool back_transform=0);
114 
116  void yRand();
118 
119 
124  vector<vector<double> > test_substances_;
125 
128 
130  vector<string> substances_names_;
131 
132 
135 
138 
141 
142  };
143  }
144 }
145 
146 
147 
148 #endif // VALIDATION