BALL
1.4.1
|
00001 /* kplsModel.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 KPLSMODEL 00027 #define KPLSMODEL 00028 00029 #ifndef KMODEL 00030 #include <BALL/QSAR/kernelModel.h> 00031 #endif 00032 00033 #ifndef NLMODEL 00034 #include <BALL/QSAR/nonlinearModel.h> 00035 #endif 00036 00037 #include <BALL/QSAR/latentVariableModel.h> 00038 00039 namespace BALL 00040 { 00041 namespace QSAR 00042 { 00044 class BALL_EXPORT KPLSModel : public KernelModel, public LatentVariableModel 00045 { 00046 public: 00050 KPLSModel(const QSARData& q, int k_type, double p1, double p2=-1); 00051 00052 KPLSModel(const QSARData& q, Vector<double>& w); 00053 00054 KPLSModel(const QSARData& q, String s1, String s2); 00055 00056 KPLSModel(const QSARData& q, const LinearModel& lm, int column); 00057 00058 ~KPLSModel(); 00060 00061 00065 00066 void train(); 00067 00069 bool optimizeParameters(int k, int no_steps); 00070 00072 int getNoComponents(); 00073 00074 void setNoComponents(int d); 00075 00077 const Matrix<double>* getU(); 00078 00079 void setParameters(vector<double>& v); 00080 00081 vector<double> getParameters() const; 00083 00084 00085 protected: 00088 Matrix<double> U_; 00089 00090 int no_components_; 00092 00093 }; 00094 } 00095 } 00096 00097 #endif // KPLSMODEL