00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2006 Mikio L. Braun 00008 * Written (W) 1999-2009 Soeren Sonnenburg 00009 * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society 00010 */ 00011 00012 #ifndef _KRR_H__ 00013 #define _KRR_H__ 00014 00015 #include "lib/config.h" 00016 #include "regression/Regression.h" 00017 00018 #ifdef HAVE_LAPACK 00019 00020 #include "classifier/KernelMachine.h" 00021 00022 namespace shogun 00023 { 00054 #define IGNORE_IN_CLASSLIST 00055 IGNORE_IN_CLASSLIST class CKRR : public CKernelMachine 00056 { 00057 public: 00059 CKRR(); 00060 00067 CKRR(float64_t tau, CKernel* k, CLabels* lab); 00068 virtual ~CKRR(); 00069 00074 inline void set_tau(float64_t t) { tau = t; }; 00075 00084 virtual bool train(CFeatures* data=NULL); 00085 00090 virtual CLabels* classify(); 00091 00097 virtual float64_t classify_example(int32_t num); 00098 00104 virtual CLabels* classify(CFeatures* data) 00105 { 00106 return CKernelMachine::classify(data); 00107 } 00108 00114 virtual bool load(FILE* srcfile); 00115 00121 virtual bool save(FILE* dstfile); 00122 00127 inline virtual EClassifierType get_classifier_type() 00128 { 00129 return CT_KRR; 00130 } 00131 00133 inline virtual const char* get_name() const { return "KRR"; } 00134 00135 private: 00137 float64_t *alpha; 00139 float64_t tau; 00140 }; 00141 } 00142 #endif // HAVE_LAPACK 00143 #endif // _KRR_H__