BALL  1.4.1
regressionModel.h
Go to the documentation of this file.
00001 /* regressionModel.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 REGRESSION
00027 #define REGRESSION
00028 
00029 #ifndef MODELH
00030 #include <BALL/QSAR/Model.h>
00031 #endif
00032 
00033 #ifndef REGVALIDATION
00034 #include <BALL/QSAR/regressionValidation.h>
00035 #endif
00036 
00037 #include <fstream>
00038 
00039 namespace BALL
00040 {
00041   namespace QSAR
00042   {
00043     class BALL_EXPORT RegressionModel : public Model
00044     {
00045       public:
00051         RegressionModel(const QSARData& q);
00052         
00053         ~RegressionModel();
00054 
00055         virtual void operator=(const RegressionModel& m);
00057         
00058         
00063         RegressionValidation* validation;
00064         
00066         const BALL::Matrix<double>* getTrainingResult() const; 
00067         
00068         virtual void saveToFile(string filename);
00069         
00070         virtual void readFromFile(string filename);
00071         
00072         void show();
00074         
00075         
00076       protected:
00088         BALL::Matrix<double> training_result_;
00089         
00090         // RowVector holding the regression constants (one value for each feature)
00091         Vector<double> offsets_;
00093         
00094         
00098         virtual void calculateOffsets() = 0;
00099         
00100         void readDescriptorInformationFromFile(std::ifstream& in, int no_descriptors, bool transformation, int no_coefficients);
00101         
00102         void saveDescriptorInformationToFile(std::ofstream& out);
00104         
00105         
00106         friend class RegressionValidation;
00107         
00108     };
00109   }
00110 }
00111 
00112 #endif // REGRESSION
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines