BALL  1.4.1
classificationModel.h
Go to the documentation of this file.
00001 /* classificationModel.h
00002  * 
00003  * Copyright (C) 2009 Marcel Schumann
00004  * 
00005  * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
00006  * Construction and Validation.
00007  * QuEasy is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3 of the License, or (at
00010  * your option) any later version.
00011  * 
00012  * QuEasy is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00021 // -*- Mode: C++; tab-width: 2; -*-
00022 // vi: set ts=2:
00023 //
00024 // 
00025 
00026 #ifndef CLASSIFICATION
00027 #define CLASSIFICATION
00028 
00029 #ifndef MODELH
00030 #include <BALL/QSAR/Model.h>
00031 #endif
00032 
00033 #ifndef CLASVALIDATION
00034 #include <BALL/QSAR/classificationValidation.h>
00035 #endif
00036 
00037 #ifndef QSAR_EXCEPTION
00038 #include <BALL/QSAR/exception.h>
00039 #endif
00040 
00041 
00042 namespace BALL
00043 {
00044   namespace QSAR
00045   {
00046     class BALL_EXPORT ClassificationModel : public Model
00047     {
00048       public:
00054         ClassificationModel(const QSARData& q);
00055         
00056         ~ClassificationModel();
00057 
00058         virtual void operator=(ClassificationModel& m);
00060         
00061         
00066         ClassificationValidation* validation;
00067         
00068         std::vector<int> getClassLabels();
00070         
00071         
00072       protected:
00073   
00078         void readLabels();
00079         
00081         std::vector<int> no_substances_;
00083         
00087         void readClassInformationFromFile(std::ifstream& input, int no_classes);
00088         void saveClassInformationToFile(std::ofstream& out);
00090         
00091         
00092         
00101         void (ClassificationModel::* discretizeFeatures)(uint bins, BALL::Matrix<double>& discretization_information);
00102         
00105         void (ClassificationModel::* discretizeTestDataFeatures)(Vector<double>& compound, uint bins, const BALL::Matrix<double>& discretization_information);
00106         
00107         
00109         void equalSpaceDiscretization(uint bins, BALL::Matrix<double>& discretization_information);
00110         
00111         void equalSpaceDiscretizationTestData(Vector<double>& compound, uint bins, const BALL::Matrix<double>& discretization_information);
00112         
00113         
00114         
00115         
00117         
00118   
00123         std::vector<int> labels_;
00125         
00126         friend class ClassificationValidation;
00127         
00128         
00129         
00130     };
00131   }
00132 }
00133 
00134 #endif // CLASSIFICATION
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines