BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
classificationModel.h
Go to the documentation of this file.
1 /* classificationModel.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 CLASSIFICATION
27 #define CLASSIFICATION
28 
29 #ifndef MODELH
30 #include <BALL/QSAR/Model.h>
31 #endif
32 
33 #ifndef CLASVALIDATION
35 #endif
36 
37 #ifndef QSAR_EXCEPTION
38 #include <BALL/QSAR/exception.h>
39 #endif
40 
41 
42 namespace BALL
43 {
44  namespace QSAR
45  {
47  {
48  public:
54  ClassificationModel(const QSARData& q);
55 
57 
58  virtual void operator=(ClassificationModel& m);
60 
61 
67 
68  std::vector<int> getClassLabels();
70 
71 
72  protected:
73 
78  void readLabels();
79 
81  std::vector<int> no_substances_;
83 
87  void readClassInformationFromFile(std::ifstream& input, int no_classes);
88  void saveClassInformationToFile(std::ofstream& out);
90 
91 
92 
101  void (ClassificationModel::* discretizeFeatures)(uint bins, BALL::Matrix<double>& discretization_information);
102 
105  void (ClassificationModel::* discretizeTestDataFeatures)(Vector<double>& compound, uint bins, const BALL::Matrix<double>& discretization_information);
106 
107 
109  void equalSpaceDiscretization(uint bins, BALL::Matrix<double>& discretization_information);
110 
111  void equalSpaceDiscretizationTestData(Vector<double>& compound, uint bins, const BALL::Matrix<double>& discretization_information);
112 
113 
114 
115 
117 
118 
123  std::vector<int> labels_;
125 
127 
128 
129 
130  };
131  }
132 }
133 
134 #endif // CLASSIFICATION